Skip to content

Commit c11cbd5

Browse files
authored
Make bencher CLI Nix job required for releases (#812)
This changeset makes the `bencher` CLI Nix job required for a successful release. The Bencher API Nix flake was removed as a part of this change. The Bencher API Docker image should be used: https://bencher.dev/download/#api-server
1 parent 46d007c commit c11cbd5

4 files changed

Lines changed: 26 additions & 101 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
cli: ${{ steps.filter.outputs.cli }}
3030
docker: ${{ steps.filter.outputs.docker }}
3131
runner: ${{ steps.filter.outputs.runner }}
32+
nix: ${{ steps.filter.outputs.nix }}
3233
steps:
3334
- uses: actions/checkout@v6
3435
- uses: dorny/paths-filter@v4
@@ -80,6 +81,9 @@ jobs:
8081
- 'plus/bencher_runner/**'
8182
- 'services/runner/**'
8283
- 'tasks/test_runner/**'
84+
nix:
85+
- 'flake.nix'
86+
- 'flake.lock'
8387
8488
lint:
8589
name: Lint
@@ -152,6 +156,15 @@ jobs:
152156
mold-version: "2.34.1"
153157
litestream-version: "0.5.10"
154158

159+
nix:
160+
name: Nix
161+
needs: changes
162+
if: github.ref != 'refs/heads/cloud'
163+
uses: ./.github/workflows/nix.yml
164+
with:
165+
nix-lint: ${{ needs.changes.outputs.nix == 'true' }}
166+
nix-build: ${{ needs.changes.outputs.nix == 'true' || needs.changes.outputs.cli == 'true' }}
167+
155168
deploy:
156169
name: Deploy
157170
needs: [lint, cli, test, build]
@@ -174,7 +187,7 @@ jobs:
174187
release:
175188
name: Release
176189
if: ${{ !failure() && !cancelled() && github.ref != 'refs/heads/cloud' && (needs.changes.outputs.rust == 'true' || github.ref == 'refs/heads/devel' || startsWith(github.ref, 'refs/tags/')) }}
177-
needs: [changes, lint, cli, runner, test, build, docker]
190+
needs: [changes, lint, cli, runner, test, build, docker, nix]
178191
uses: ./.github/workflows/release.yml
179192
with:
180193
mold-version: "2.34.1"

.github/workflows/nix.yml

Lines changed: 11 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,19 @@
11
name: Nix
22

33
on:
4-
workflow_dispatch:
5-
push:
6-
branches: [devel, cloud]
7-
tags: [v**]
8-
pull_request:
9-
branches: [main, cloud, devel]
10-
11-
# Cancel in-progress runs for the same branch
12-
concurrency:
13-
group: ${{ github.workflow }}-${{ github.ref }}
14-
cancel-in-progress: true
4+
workflow_call:
5+
inputs:
6+
nix-lint:
7+
type: boolean
8+
required: true
9+
nix-build:
10+
type: boolean
11+
required: true
1512

1613
jobs:
17-
changes:
18-
name: Detect Changes
19-
if: github.ref != 'refs/heads/cloud'
20-
runs-on: ubuntu-22.04
21-
outputs:
22-
nix: ${{ steps.filter.outputs.nix }}
23-
cli: ${{ steps.filter.outputs.cli }}
24-
api: ${{ steps.filter.outputs.api }}
25-
steps:
26-
- uses: actions/checkout@v6
27-
- uses: dorny/paths-filter@v4
28-
id: filter
29-
with:
30-
filters: |
31-
nix:
32-
- 'flake.nix'
33-
- 'flake.lock'
34-
- '.github/workflows/nix.yml'
35-
cli:
36-
- 'services/cli/**'
37-
- 'lib/bencher_adapter/**'
38-
- 'lib/bencher_client/**'
39-
- 'lib/bencher_comment/**'
40-
- 'lib/bencher_context/**'
41-
- 'lib/bencher_json/**'
42-
- 'lib/bencher_noise/**'
43-
- 'lib/bencher_parser/**'
44-
- 'lib/bencher_valid/**'
45-
api:
46-
- 'services/api/**'
47-
- 'lib/api_auth/**'
48-
- 'lib/api_checkout/**'
49-
- 'lib/api_organizations/**'
50-
- 'lib/api_projects/**'
51-
- 'lib/api_run/**'
52-
- 'lib/api_server/**'
53-
- 'lib/api_users/**'
54-
- 'lib/bencher_adapter/**'
55-
- 'lib/bencher_boundary/**'
56-
- 'lib/bencher_config/**'
57-
- 'lib/bencher_context/**'
58-
- 'lib/bencher_endpoint/**'
59-
- 'lib/bencher_json/**'
60-
- 'lib/bencher_logger/**'
61-
- 'lib/bencher_plot/**'
62-
- 'lib/bencher_rank/**'
63-
- 'lib/bencher_rbac/**'
64-
- 'lib/bencher_schema/**'
65-
- 'lib/bencher_token/**'
66-
- 'lib/bencher_valid/**'
67-
- 'plus/api_oci/**'
68-
- 'plus/api_runners/**'
69-
- 'plus/api_specs/**'
70-
- 'plus/bencher_billing/**'
71-
- 'plus/bencher_bing_index/**'
72-
- 'plus/bencher_github_client/**'
73-
- 'plus/bencher_google_client/**'
74-
- 'plus/bencher_google_index/**'
75-
- 'plus/bencher_license/**'
76-
- 'plus/bencher_oci_storage/**'
77-
- 'plus/bencher_otel/**'
78-
- 'plus/bencher_otel_provider/**'
79-
- 'plus/bencher_recaptcha/**'
80-
8114
nix_lints:
82-
name: Check nix code
83-
needs: changes
84-
if: ${{ needs.changes.outputs.nix == 'true' }}
15+
name: Check Nix code
16+
if: ${{ inputs.nix-lint }}
8517
runs-on: ubuntu-22.04
8618
steps:
8719
- uses: actions/checkout@v6
@@ -98,8 +30,7 @@ jobs:
9830

9931
build_bencher_nix:
10032
name: Build `bencher` Nix Package
101-
needs: changes
102-
if: ${{ needs.changes.outputs.nix == 'true' || needs.changes.outputs.cli == 'true' }}
33+
if: ${{ inputs.nix-build }}
10334
runs-on: ubuntu-22.04
10435
steps:
10536
- uses: actions/checkout@v6
@@ -109,17 +40,3 @@ jobs:
10940
nix_path: nixpkgs=channel:nixos-25.11
11041
- name: Nix build
11142
run: nix build .#bencher
112-
113-
build_api_nix:
114-
name: Build `api` Nix Package
115-
needs: changes
116-
if: ${{ needs.changes.outputs.nix == 'true' || needs.changes.outputs.api == 'true' }}
117-
runs-on: ubuntu-22.04
118-
steps:
119-
- uses: actions/checkout@v6
120-
- name: Install Nix
121-
uses: cachix/install-nix-action@v25
122-
with:
123-
nix_path: nixpkgs=channel:nixos-25.11
124-
- name: Nix build
125-
run: nix build .#api

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,4 @@ When adding a new crate, update all four `Dockerfile`s:
178178

179179
## CI Path Filters
180180

181-
When adding a new crate or changing crate dependencies, update the path filters in `.github/workflows/ci.yml` and `.github/workflows/nix.yml` (`changes` jobs) for any affected filter (`rust`, `api`, `cli`, `runner`, `console`, `action`, `docker`).
181+
When adding a new crate or changing crate dependencies, update the path filters in `.github/workflows/ci.yml` (`changes` job) for any affected filter (`rust`, `cli`, `runner`, `console`, `action`, `docker`, `nix`).

flake.nix

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
packages = rec {
6363
default = bencher;
6464
bencher = mkPackage "bencher";
65-
api = mkPackage "api";
6665
};
6766
# Enter reproducible development shell with `nix develop`
6867
devShells = {
@@ -82,10 +81,6 @@
8281
bencher = flake-utils.lib.mkApp {
8382
drv = self.packages.${system}.bencher;
8483
};
85-
# nix run .#api
86-
api = flake-utils.lib.mkApp {
87-
drv = self.packages.${system}.api;
88-
};
8984
};
9085
}
9186
);

0 commit comments

Comments
 (0)