[ci] Move unit tests to after WASM build — smoke test needs artifacts #64
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: ci | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: | |
| contents: write # needed for gh release upload (publish:circt step) | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 180 | |
| env: | |
| CIRCT_WASM_JOBS: "4" | |
| CIRCT_WASM_CONFIGURE_TIMEOUT_MIN: "45" | |
| CIRCT_WASM_BUILD_TIMEOUT_MIN: "150" | |
| CIRCT_WASM_CLEAN_BUILD: "1" | |
| GH_TOKEN: ${{ secrets.CIRCT_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: npm | |
| - name: Restore emsdk cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .cache/emsdk | |
| key: emsdk-${{ runner.os }}-4.0.21 | |
| - name: Install host prerequisites | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y rsync unzip ninja-build | |
| - name: Install emsdk 4.0.21 | |
| run: | | |
| EMSDK_DIR="$GITHUB_WORKSPACE/.cache/emsdk" | |
| if [ ! -d "$EMSDK_DIR/.git" ]; then | |
| rm -rf "$EMSDK_DIR" | |
| git clone https://github.com/emscripten-core/emsdk.git "$EMSDK_DIR" | |
| fi | |
| "$EMSDK_DIR/emsdk" install 4.0.21 | |
| "$EMSDK_DIR/emsdk" activate 4.0.21 | |
| echo "EMSDK=$EMSDK_DIR" >> "$GITHUB_ENV" | |
| echo "$EMSDK_DIR" >> "$GITHUB_PATH" | |
| echo "$EMSDK_DIR/upstream/emscripten" >> "$GITHUB_PATH" | |
| - name: Install npm dependencies | |
| run: npm ci | |
| - name: Validate requirements | |
| run: scripts/check-requirements.sh --with-wasm | |
| - name: Setup Surfer assets | |
| run: scripts/setup-surfer.sh | |
| - name: Setup Pyodide assets | |
| run: scripts/setup-pyodide.sh | |
| - name: Configure git credentials for private CIRCT fork | |
| run: gh auth setup-git | |
| - name: Setup pinned CIRCT checkout | |
| run: scripts/setup-circt.sh | |
| - name: Build CIRCT wasm artifacts | |
| run: scripts/build-circt-wasm.sh | |
| - name: Sync CIRCT wasm into app | |
| run: npm run sync:circt | |
| - name: Run unit tests | |
| run: npm test | |
| - name: Build tutorial app | |
| run: npm run build | |
| - name: Install Playwright browser (UVM smoke) | |
| run: npx playwright install --with-deps chromium | |
| - name: UVM browser-worker smoke (reporting lesson) | |
| run: | | |
| LOG_DIR="$RUNNER_TEMP/uvm-smoke-logs" | |
| mkdir -p "$LOG_DIR" | |
| ./scripts/run-uvm-browser-worker-matrix.sh \ | |
| --smoke \ | |
| --retries 3 \ | |
| --log-dir "$LOG_DIR" | |
| - name: Publish CIRCT wasm to release | |
| if: github.ref == 'refs/heads/main' | |
| run: npm run publish:circt | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload UVM smoke logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: uvm-smoke-logs-${{ github.run_id }} | |
| path: ${{ runner.temp }}/uvm-smoke-logs | |
| if-no-files-found: ignore |