Skip to content

Commit ac8f234

Browse files
committed
benchmark inside nix
1 parent 0a324c5 commit ac8f234

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

.github/workflows/ci_zig_benchmarks.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,24 @@ jobs:
1313
timeout-minutes: 90
1414
steps:
1515
# === MAIN BRANCH BUILD ===
16+
# TEMPORARY: Using PR branch for both to test CI workflow - revert to ref: "main" after testing
1617
- name: Checkout main branch
1718
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4
1819
with:
19-
ref: "main"
20+
# ref: "main"
2021
clean: "true"
2122

22-
- uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # ratchet:mlugg/setup-zig@v2.0.5
23+
- uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f # ratchet:cachix/install-nix-action@v31
2324
with:
24-
version: 0.15.2
25-
use-cache: true
25+
nix_path: nixpkgs=channel:nixos-25.05
2626

2727
- name: Verify prerequisites
28-
run: |
29-
hyperfine --version
30-
jq --version
28+
run: nix develop ./src/ -c bash -c "hyperfine --version && jq --version && zig version"
3129

3230
- name: Build main branch release binary and snapshot tool
3331
uses: ./.github/actions/flaky-retry
3432
with:
35-
command: "zig build release snapshot -Doptimize=ReleaseFast"
33+
command: "nix develop ./src/ -c bash -c 'zig build release snapshot -Doptimize=ReleaseFast'"
3634
error_string_contains: "build.zig.zon"
3735
retry_count: 3
3836

@@ -51,7 +49,7 @@ jobs:
5149
- name: Build PR branch release binary and snapshot tool
5250
uses: ./.github/actions/flaky-retry
5351
with:
54-
command: "zig build release snapshot -Doptimize=ReleaseFast"
52+
command: "nix develop ./src/ -c bash -c 'zig build release snapshot -Doptimize=ReleaseFast'"
5553
error_string_contains: "build.zig.zon"
5654
retry_count: 3
5755

@@ -63,4 +61,4 @@ jobs:
6361
6462
# === RUN BENCHMARKS ===
6563
- name: Run benchmarks
66-
run: ./ci/benchmarks_zig/run_local_benchmarks.sh --main-dir bench-main --pr-dir bench-pr
64+
run: nix develop ./src/ -c ./ci/benchmarks_zig/run_local_benchmarks.sh --main-dir bench-main --pr-dir bench-pr

0 commit comments

Comments
 (0)