build: use custom step instead of install step #34
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: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Zig 0.15.1 | |
| uses: goto-bus-stop/setup-zig@v2 | |
| with: | |
| version: 0.15.1 | |
| - name: Setup Bun 1.3 | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: "1.3" | |
| - name: Cache Zig dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/zig | |
| zig-cache | |
| key: ${{ runner.os }}-zig-${{ hashFiles('build.zig.zon') }} | |
| restore-keys: | | |
| ${{ runner.os }}-zig- | |
| - name: Cache Bun dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| tests/node_modules | |
| ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-${{ hashFiles('tests/package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install Node.js dependencies | |
| run: bun install | |
| working-directory: tests | |
| - name: Build Zig project | |
| run: zig build test-modules | |
| - name: Run tests | |
| run: bun test --reporter=junit --reporter-outfile=test-results.xml | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: test-results.xml | |
| retention-days: 30 |