diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e9d5399..6d9f45c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 + # " diff --git a/tests/basic_test.gtkw b/tests/test_basic/basic_test.gtkw similarity index 100% rename from tests/basic_test.gtkw rename to tests/test_basic/basic_test.gtkw