Build all tests in CI
This commit is contained in:
45
.github/workflows/build.yml
vendored
45
.github/workflows/build.yml
vendored
@@ -16,9 +16,24 @@ jobs:
|
||||
# # ./tests
|
||||
# # extra_args: "--check_syntax=true"
|
||||
|
||||
test:
|
||||
name: Build C code
|
||||
enumerate-tests:
|
||||
name: Enumerate tests
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- id: set-matrix
|
||||
run: echo "::set-output name=matrix::$(ls tests | grep test_* | jq -R -s -c 'split("\n")[:-1]')"
|
||||
|
||||
test:
|
||||
needs: enumerate-tests
|
||||
name: Run Test `${{ matrix.test }}`
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
test: ${{ fromJson(needs.enumerate-tests.outputs.matrix) }}
|
||||
max-parallel: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build executables
|
||||
@@ -28,20 +43,20 @@ jobs:
|
||||
args: |
|
||||
-c "\
|
||||
riscv64-unknown-elf-gcc --version && \
|
||||
cd tests/test_basic && \
|
||||
riscv64-unknown-elf-as test.S -o test.o && \
|
||||
riscv64-unknown-elf-ld -T tb.ld test.o -o test.elf && \
|
||||
cd tests/${{ matrix.test }} && \
|
||||
make test.o && \
|
||||
riscv64-unknown-elf-ld -melf32lriscv -T tb.ld test.o -o test.elf && \
|
||||
riscv64-unknown-elf-objcopy --target=verilog test.elf test.hex && \
|
||||
echo "done" \
|
||||
"
|
||||
|
||||
- name: Run Simulation
|
||||
uses: docker://andrsmllr/iverilog:latest
|
||||
with:
|
||||
entrypoint: bash
|
||||
args: |
|
||||
-c "\
|
||||
cd tests/test_basic && \
|
||||
iverilog -g2012 -o test.out tb.sv ../../src/*.v -Y .sv -I ../../lib && \
|
||||
./test.out | tee test.log
|
||||
"
|
||||
# - name: Run Simulation
|
||||
# uses: docker://andrsmllr/iverilog:latest
|
||||
# with:
|
||||
# entrypoint: bash
|
||||
# args: |
|
||||
# -c "\
|
||||
# cd tests/test_basic && \
|
||||
# iverilog -g2012 -o test.out tb.sv ../../src/*.v -Y .sv -I ../../lib && \
|
||||
# ./test.out | tee test.log
|
||||
# "
|
||||
|
Reference in New Issue
Block a user