Repository navigation
Add flight tracker demo and update wasm demo documentation #22
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: [master] | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.16.0 | |
| - name: Lint (zig fmt --check) | |
| run: zig build lint | |
| - name: Build | |
| run: zig build | |
| - name: Unit tests | |
| run: zig build test --summary all | |
| - name: Integration tests | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| env: | |
| SERPAPI_KEY: ${{ secrets.SERPAPI_KEY }} | |
| run: zig build itest --summary all | |
| # Runs on macOS: kcov reads the unit-test binary's debug info there, | |
| # while on Linux it reports zero instrumented files for that binary | |
| # (the integration binary works on both). | |
| coverage: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.16.0 | |
| - name: Install kcov | |
| run: brew install kcov | |
| - name: Code coverage | |
| env: | |
| SERPAPI_KEY: ${{ secrets.SERPAPI_KEY }} | |
| run: | | |
| zig build cov | |
| for f in $(find zig-out/coverage -maxdepth 3 -name coverage.json); do | |
| echo "$f: $(head -c 300 $f | tr -d '\n')" | |
| done | |
| python3 - <<'EOF' >> "$GITHUB_STEP_SUMMARY" | |
| import json | |
| report = json.load(open("zig-out/coverage/merged/kcov-merged/coverage.json")) | |
| print("## Code coverage: %s%%\n" % report["percent_covered"]) | |
| print("| file | covered | total | percent |") | |
| print("|---|---|---|---|") | |
| for f in report["files"]: | |
| print("| %s | %s | %s | %s%% |" % ( | |
| f["file"].split("/")[-1], f["covered_lines"], | |
| f["total_lines"], f["percent_covered"])) | |
| EOF | |
| - name: Upload HTML report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: zig-out/coverage/merged/kcov-merged |