Skip to content

feat(ci): test matrix #3

feat(ci): test matrix

feat(ci): test matrix #3

Workflow file for this run

name: RISC-V Simulator CI

Check failure on line 1 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/main.yml

Invalid workflow file

(Line: 32, Col: 1): 'name' is already defined, (Line: 34, Col: 1): 'on' is already defined, (Line: 40, Col: 1): 'jobs' is already defined
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"