ci: run hdl tests on all-in-one container

This commit is contained in:
umarcor 2021-05-17 08:17:07 +02:00
parent f45063ca15
commit 8e89c5d825
5 changed files with 85 additions and 46 deletions

50
.github/hdl-tests.sh vendored Executable file
View File

@ -0,0 +1,50 @@
#!/bin/bash
set -e
cd $(dirname "$0")/../hdl
echo '::group::Verilog Blink example'
(
set -x
cd verilog/blink
make FOMU_REV=pvt blink.bit
[ -f blink.bit ]
)
echo '::endgroup::'
echo '::group::Verilog Blink (expanded) example for Hacker board'
(
set -x
cd verilog/blink-expanded
make FOMU_REV=hacker blink.bin
[ -f blink.bin ]
)
echo '::endgroup::'
echo '::group::Verilog Blink (expanded) example for PVT board'
(
set -x
cd verilog/blink-expanded
make FOMU_REV=pvt blink.bin
[ -f blink.bin ]
)
echo '::endgroup::'
echo '::group::VHDL Blink example'
(
set -x
cd vhdl/blink
make FOMU_REV=pvt blink.bit
[ -f blink.bit ]
)
echo '::endgroup::'
echo '::group::Mixed HDL Blink example'
(
set -x
cd mixed/blink
make FOMU_REV=pvt blink.bit
[ -f blink.bit ]
)
echo '::endgroup::'

47
.github/tests.sh vendored
View File

@ -8,6 +8,8 @@ echo "TOOLCHAIN_PATH: $TOOLCHAIN_PATH"
export PATH=$TOOLCHAIN_PATH/bin:$PATH
export GHDL_PREFIX=$TOOLCHAIN_PATH/lib/ghdl
$(dirname "$0")/hdl-tests.sh
echo '::group::RISC-V C Example'
(
set -x
@ -26,51 +28,6 @@ echo '::group::RISC-V Zig Example'
)
echo '::endgroup::'
echo '::group::Verilog Blink example'
(
set -x
cd hdl/verilog/blink
make FOMU_REV=pvt
file blink.dfu
)
echo '::endgroup::'
echo '::group::Verilog Blink (expanded) example for Hacker board'
(
set -x
cd hdl/verilog/blink-expanded
make FOMU_REV=hacker
file blink.dfu
)
echo '::endgroup::'
echo '::group::Verilog Blink (expanded) example for PVT board'
(
set -x
cd hdl/verilog/blink-expanded
make FOMU_REV=pvt
file blink.dfu
)
echo '::endgroup::'
echo '::group::VHDL Blink example'
(
set -x
cd hdl/vhdl/blink
make FOMU_REV=pvt
file blink.dfu
)
echo '::endgroup::'
echo '::group::Mixed HDL Blink example'
(
set -x
cd hdl/mixed/blink
make FOMU_REV=pvt
file blink.dfu
)
echo '::endgroup::'
echo '::group::LiteX example for Hacker'
(
set -x

View File

@ -9,13 +9,18 @@ on:
jobs:
test:
strategy:
fail-fast: false
max-parallel: 3
matrix:
os: [ ubuntu, windows, macos ]
include:
- { icon: 🐧, os: ubuntu }
- { icon: 🟦, os: windows }
- { icon: 🍎, os: macos }
runs-on: ${{ matrix.os }}-latest
name: '${{ matrix.icon}} ${{ matrix.os }}'
defaults:
run:
shell: bash
@ -59,3 +64,20 @@ jobs:
GH_TOKEN: ${{ github.token }}
- run: ./.github/tests.sh
all-in-one:
name: '🛳️ All-in-one'
runs-on: ubuntu-latest
env:
GHDL_PLUGIN_MODULE: ghdl
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- uses: docker://ghcr.io/hdl/debian-buster/impl
with:
args: ./.github/hdl-tests.sh

View File

@ -15,6 +15,11 @@ YOSYS ?= yosys
NEXTPNR ?= nextpnr-ice40
ICEPACK ?= icepack
# If ghdl-yosys-plugin is built as a module (not the case with fomu-toolchain)
ifdef GHDL_PLUGIN_MODULE
YOSYSFLAGS += -m $(GHDL_PLUGIN_MODULE)
endif
# Default target: run all required targets to build the DFU image.
all: blink.dfu
@true

View File

@ -9,6 +9,11 @@ YOSYS ?= yosys
NEXTPNR ?= nextpnr-ice40
ICEPACK ?= icepack
# If ghdl-yosys-plugin is built as a module (not the case with fomu-toolchain)
ifdef GHDL_PLUGIN_MODULE
YOSYSFLAGS += -m $(GHDL_PLUGIN_MODULE)
endif
# Default target: run all required targets to build the DFU image.
all: blink.dfu
@true