ci: test error surfacing via diaconuccalin/pulp-actions fork #103
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: GEMM Chain CI | |
| on: | |
| push: | |
| workflow_dispatch: | |
| jobs: | |
| gemm: | |
| name: GEMM chain [8x8 mesh] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake build-essential python3-pip | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| - name: Install Python dependencies | |
| run: | | |
| pip install uv | |
| uv pip install --system ".[gemm]" | |
| - name: Cache RISC-V toolchain | |
| id: cache-riscv | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/riscv | |
| key: pulp-riscv-gcc-v1.0.16 | |
| - name: Install PULP RISC-V toolchain | |
| if: steps.cache-riscv.outputs.cache-hit != 'true' | |
| run: | | |
| wget -q https://github.com/pulp-platform/pulp-riscv-gnu-toolchain/releases/download/v1.0.16/v1.0.16-pulp-riscv-gcc-ubuntu-18.tar.bz2 -O /tmp/riscv-toolchain.tar.bz2 | |
| mkdir -p ~/riscv | |
| tar -xjf /tmp/riscv-toolchain.tar.bz2 -C ~/riscv --strip-components=1 | |
| rm /tmp/riscv-toolchain.tar.bz2 | |
| - name: Add toolchain to PATH | |
| run: echo "$HOME/riscv/bin" >> "$GITHUB_PATH" | |
| - name: Verify toolchain | |
| run: riscv32-unknown-elf-gcc --version | |
| - name: Cache GVSoC | |
| id: cache-gvsoc | |
| uses: actions/cache@v4 | |
| with: | |
| path: gvsoc | |
| key: gvsoc-v1-tiles-8 | |
| restore-keys: | | |
| gvsoc-v1-tiles- | |
| gvsoc-v1- | |
| - name: Clone GVSoC | |
| if: steps.cache-gvsoc.outputs.cache-hit != 'true' | |
| run: | | |
| if [ ! -d "gvsoc" ]; then | |
| git config --global url."https://github.com/".insteadOf "git@github.com:" | |
| make gvsoc_init | |
| fi | |
| - name: Install GVSoC Python dependencies | |
| run: | | |
| pip install -r gvsoc/core/requirements.txt | |
| pip install -r gvsoc/requirements.txt | |
| pip install -r gvsoc/gvrun/requirements.txt | |
| - name: Build GVSoC | |
| run: make gvsoc tiles=8 | |
| - name: Build GEMM test | |
| run: TILES=8 COMPILER=GCC_PULP bash scripts/gemm/gemm-build.sh | |
| - name: Run GEMM chain test (8x8 mesh) | |
| run: | | |
| output=$(TILES=8 bash scripts/gemm/gemm-run.sh 2>&1) || true | |
| result=$(echo "$output" | grep -E 'Errors:|Test complete' || true) | |
| echo "$result" | |
| errors=$(echo "$output" | grep -oP 'Errors:\s*\K[0-9]+' | head -1) | |
| if [ -z "$errors" ]; then | |
| echo "ERROR: Could not parse test output" | |
| echo "Full output:" | |
| echo "$output" | |
| exit 1 | |
| elif [ "$errors" -gt 0 ]; then | |
| echo "FAIL: $errors errors" | |
| exit 1 | |
| else | |
| echo "PASS: 0 errors" | |
| fi |