feat(ci): test matrix #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: RISC-V Simulator CI | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| jobs: | ||
| build-and-run-tests: | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: docker.io/harsonlau/riscv-tools:latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Run All Tests | ||
| run: | | ||
| set -e | ||
| for test_file in test/src/*.c; do | ||
| test_name=$(basename "$test_file" .c) | ||
| echo "---" | ||
| echo "🚀 Running test: $test_name" | ||
| echo "---" | ||
| make T="$test_name" 2>&1 | tee /dev/stderr | grep -q "HIT GOOD TRAP" | ||
| done | ||
| name: RISC-V Simulator CI | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| jobs: | ||
| build-simulator: | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: docker.io/harsonlau/riscv-tools:latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Build Simulator | ||
| run: make -C sim | ||
| - name: Upload Simulator Artifact | ||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: simulator-build | ||
| path: sim/build | ||
| run-all-tests: | ||
| needs: build-simulator | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: docker.io/harsonlau/riscv-tools:latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| test_name: [ | ||
| 'ackermann', | ||
| 'add', | ||
| 'div', | ||
| 'dummy', | ||
| 'if-else', | ||
| 'load-store', | ||
| 'matrix-mul', | ||
| 'quicksort', | ||
| 'shift', | ||
| 'unalign' | ||
| ] | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Download Simulator Artifact | ||
| uses: actions/download-artifact@v3 | ||
| with: | ||
| name: simulator-build | ||
| path: sim/build | ||
| - name: Run Test (${{ matrix.test_name }}) | ||
| run: make T=${{ matrix.test_name }} 2>&1 | tee /dev/stderr | grep -q "HIT GOOD TRAP" | ||