Skip to content

Commit 388496f

Browse files
committed
ci: drop the dev shell from pkg-pr-new and document why
The pkg-pr-new dry-run job entered the full `nix develop` dev shell only to run `pnpm pkg-pr-new publish`. Packing repackages the native binaries restored from the build matrix, so no Rust toolchain is involved (bun is fetched via the engines.runtime entry during `pnpm install`). Provision just pnpm with `nix profile install --inputs-from . nixpkgs#pnpm` plus an explicit `pnpm install --frozen-lockfile`, matching the release and perf-comment jobs. Add comments to the pkg-pr-new and perf-comment jobs explaining why the dev shell is unnecessary, since the reasoning (prebuilt binaries, no cargo) is not obvious from the step alone.
1 parent 95cfc77 commit 388496f

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ jobs:
143143
steps:
144144
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
145145
- uses: ./.github/actions/setup-nix
146+
# Packing only repackages the native binaries restored from the build
147+
# matrix below (no Rust build happens here), so the full `nix develop` dev
148+
# shell is unnecessary. Provision just pnpm; bun is fetched via the
149+
# engines.runtime entry during `pnpm install` for the prepack scripts.
150+
- run: nix profile install --inputs-from . nixpkgs#pnpm
151+
- run: pnpm install --frozen-lockfile
146152
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
147153
with:
148154
pattern: ccusage-native-*
@@ -154,7 +160,7 @@ jobs:
154160
tar -xf "$archive"
155161
done
156162
- id: publish
157-
run: nix develop --command pnpm pkg-pr-new publish --pnpm --bin './apps/ccusage' './packages/ccusage-linux-arm64' './packages/ccusage-linux-x64' './packages/ccusage-darwin-arm64' './packages/ccusage-win32-x64'
163+
run: pnpm pkg-pr-new publish --pnpm --bin './apps/ccusage' './packages/ccusage-linux-arm64' './packages/ccusage-linux-x64' './packages/ccusage-darwin-arm64' './packages/ccusage-win32-x64'
158164

159165
ccusage-preview-e2e:
160166
if: github.event_name == 'pull_request' && needs.changes.outputs.code-changed == 'true'
@@ -220,6 +226,10 @@ jobs:
220226

221227
- name: Setup Nix
222228
uses: ./.github/actions/setup-nix
229+
# This job only benchmarks the prebuilt ccusage binary bundled in the
230+
# installed pkg.pr.new package (no Rust build happens here), so the full
231+
# `nix develop` dev shell is unnecessary. Install just the tools the perf
232+
# scripts invoke, pinned to the flake's nixpkgs via `--inputs-from .`.
223233
- name: Install perf tooling
224234
run: nix profile install --inputs-from . nixpkgs#pnpm nixpkgs#bun nixpkgs#hyperfine nixpkgs#just
225235
- run: pnpm install --frozen-lockfile
@@ -294,6 +304,10 @@ jobs:
294304

295305
- name: Setup Nix
296306
uses: ./.github/actions/setup-nix
307+
# This job only benchmarks the prebuilt ccusage binary bundled in the
308+
# installed pkg.pr.new package (no Rust build happens here), so the full
309+
# `nix develop` dev shell is unnecessary. Install just the tools the perf
310+
# scripts invoke, pinned to the flake's nixpkgs via `--inputs-from .`.
297311
- name: Install perf tooling
298312
run: nix profile install --inputs-from . nixpkgs#pnpm nixpkgs#bun nixpkgs#hyperfine nixpkgs#just
299313
- run: pnpm install --frozen-lockfile

0 commit comments

Comments
 (0)