fix: address Gemini review on #16 #57
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: read | |
| jobs: | |
| build: | |
| name: build (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 | |
| with: | |
| version: 0.16.0 | |
| - name: zig build (debug) | |
| run: zig build | |
| - name: zig build (release-small) | |
| run: zig build --release=small | |
| - name: report wasm size | |
| run: | | |
| ls -l zig-out/bin/zopa.wasm | |
| wc -c zig-out/bin/zopa.wasm | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| if: matrix.os == 'ubuntu-latest' | |
| with: | |
| name: zopa.wasm | |
| path: zig-out/bin/zopa.wasm | |
| if-no-files-found: error | |
| test-unit: | |
| name: test (unit) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 | |
| with: | |
| version: 0.16.0 | |
| - name: zig build test-unit | |
| run: zig build test-unit | |
| bench: | |
| name: bench (smoke) | |
| runs-on: ubuntu-latest | |
| # No `needs: build` -- `zig build bench` rebuilds the wasm via | |
| # the install step, so depending on the artifact job adds wait | |
| # time without saving work. | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 | |
| with: | |
| version: 0.16.0 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 22 | |
| - name: zig build bench | |
| run: zig build bench | |
| test-node: | |
| name: test (node) | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 | |
| with: | |
| version: 0.16.0 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 22 | |
| - name: zig build test | |
| run: zig build test | |
| test-wasmtime: | |
| name: test (wasmtime) | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 | |
| with: | |
| version: 0.16.0 | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.13" | |
| cache: pip | |
| cache-dependency-path: test/requirements.txt | |
| - name: install python deps | |
| run: | | |
| python -m venv .venv-test | |
| .venv-test/bin/pip install -r test/requirements.txt | |
| - name: zig build test-wasmtime | |
| run: zig build test-wasmtime | |
| test-conformance: | |
| name: test (conformance) | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 | |
| with: | |
| version: 0.16.0 | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.13" | |
| cache: pip | |
| cache-dependency-path: test/requirements.txt | |
| - name: install opa | |
| run: | | |
| curl -L -o /usr/local/bin/opa https://openpolicyagent.org/downloads/v1.16.1/opa_linux_amd64_static | |
| chmod +x /usr/local/bin/opa | |
| opa version | |
| - name: install python deps | |
| run: | | |
| python -m venv .venv-test | |
| .venv-test/bin/pip install -r test/requirements.txt | |
| - name: zig build test-conformance | |
| run: zig build test-conformance |