feat: add context api #120
Workflow file for this run
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: Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
ZIG_VERSION: 0.14.1 | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mlugg/setup-zig@v2 | |
with: | |
version: ${{ env.ZIG_VERSION }} | |
- run: zig fmt --check . | |
run_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mlugg/setup-zig@v2 | |
with: | |
version: ${{ env.ZIG_VERSION }} | |
- run: zig build test | |
build_examples: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mlugg/setup-zig@v2 | |
with: | |
version: ${{ env.ZIG_VERSION }} | |
- run: zig build examples | |
# Execute bencharmks only if the PR has a specific label 'run::benchmarks' | |
benchmarks: | |
if: contains(github.event.pull_request.labels.*.name, 'run::benchmarks') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mlugg/setup-zig@v2 | |
with: | |
version: ${{ env.ZIG_VERSION }} | |
# The optimize argument builds the SDK library with optimizations, | |
# benchmarks files are always compiled with ReleaseFast. | |
- run: | | |
zig build benchmarks -Doptimize=ReleaseFast 2> benchmarks-result.txt | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: benchmarks-result | |
path: benchmarks-result.txt | |
retention-days: 60 |