Skip to content

ci: run language tools from the flake dev shell - #207

Merged
furedea merged 5 commits into
mainfrom
ci/23-dev-shell
Nov 9, 2026
Merged

furedea merged 5 commits into
mainfrom
ci/23-dev-shell

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

概要

CI の言語ツールを,flake の devShell から動かす形にする.手元と CI で同じ版になり,flake.lock が中身を固定する.

項目 変更前 変更後
Rust(clippy,rustfmt,test) setup-rust-toolchain 1.99.1 devShell(locked nixpkgs の rustc 1.95.0)
cargo-deny,cargo-machete cargo-deny-action,cargo-machete action devShell(0.19.6,0.9.2)
Codex conformance setup-rust-toolchain,setup-node,bats-action,apt-get install jq devShell(bats 1.12.0,jq を追加)
Nix の準備 なし furedea/reusable-workflows の nix-setup v1.3.0
  • 各 job は checkout の後に nix-setup を呼び,defaults.run.shell: nix develop .#ci --command bash -eo pipefail {0} で動く.
  • job 名と all-green の needs は変えていない(必須チェックは影響を受けない).
  • all-green は Nix を入れないので,job 単位で defaults.run.shell: bash を指定した.
  • devShell は x86_64-linux に対応済み.flake.nix の変更は,bats と jq の追加と,cargoDist を含まない ci shell の追加.

対象外

release.yml の build job は,複数 target を cross-compile する.devShell の nixpkgs rustc にその target がないため,変更していない.

Rust の版

CI は 1.99.1 に固定していたが,locked nixpkgs の rustc は 1.95.0 になる.手元の devShell は元から 1.95.0 で,edition 2024 には十分.

CI 時間

変更前は main の run 42612630804.変更後は,初回の PR の run 42623098157(default shell)と,ci shell にした run 42627462234(head 782b016).どちらも Nix の cache なしの PR の run.

job 変更前 default shell ci shell
lint 約 17 秒 7 分 57 秒 1 分 13 秒
format 約 19 秒 4 分 30 秒 49 秒
test 約 26 秒 7 分 57 秒 1 分 23 秒
rust-audit 約 25 秒 7 分 7 秒 45 秒
execpolicy(別 workflow) 計測なし 4 分 53 秒 1 分 19 秒
全体(nix-check が支配) 約 2 分 36 秒 約 8 分 約 2 分 25 秒

default shell が遅かった原因は,devShell の cargoDist(0.30.2 に上書き)を各 job が source から約 6 分 43 秒かけてビルドしていたこと.cargoDist を含まない ci shell を追加し,CI は nix develop .#ci で動かす(release.yml は自前で dist を入れるので,CI に dist は要らない).default shell は従来のまま cargoDist を含む.

全体の待ち時間は,nix-check(変更なし)が支配するので,変更前とほぼ同じ.各 job は cache なしでも 1 分台で,main で cache が保存された後はさらに短くなる見込み(未計測).

検証

  • nix flake check --all-systems --no-build --option allow-import-from-derivation false: 成功
  • devShell 内で cargo clippy -- -D warnings,cargo fmt --check,cargo deny check,cargo machete,cargo test: 成功

Refs furedea/reusable-workflows#23
Closes furedea/reusable-workflows#22

🤖 Generated with Claude Code

furedea and others added 3 commits November 9, 2026 21:39
CI runs the repository tools from the flake dev shell, so the shell must provide
the bats runner and jq used by the Codex conformance job.

Refs furedea/reusable-workflows#23

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Replace setup-rust-toolchain, cargo-deny-action, cargo-machete, setup-node and
bats-action with the dev shell, set up by the shared nix-setup action. The
Rust toolchain now comes from the locked nixpkgs, as it does locally.
all-green keeps the default shell because it installs no Nix.

RELEASE_SHA and vRELEASE are placeholders until the nix-setup action is released.

Refs furedea/reusable-workflows#23, furedea/reusable-workflows#22

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Replace the RELEASE_SHA placeholder with the v1.3.0 commit.

Refs furedea/reusable-workflows#23

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 9, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T13:42:06.448111Z 782b016 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Review summary (read-only): no blocking findings.

Checked:

  • Workflow-level defaults.run.shell: nix develop ... only affects run: steps; reusable-workflow jobs (uses:) are unaffected, and all-green correctly overrides back to bash.
  • Every job with run: steps calls nix-setup before its first run: step.
  • codex-conformance: jq and bats now come from the devShell, npm ci uses devShell nodejs_22, and node_modules/.bin added via GITHUB_PATH still reaches later nix develop steps (the outer PATH is kept), so codex resolves.
  • Rust 1.95.0 meets edition 2024 (needs 1.85+), and Cargo.toml sets no rust-version.

Not verified: the nix-setup action source and this PR's CI run. If that action has no binary cache, the overridden cargoDist in the devShell may be rebuilt from source in each job. Keep an eye on the 10-minute job timeouts when filling in the CI timing section.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 265fd32d78

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

furedea and others added 2 commits November 9, 2026 22:19
cargo-dist is overridden to 0.30.2 and built from source, which took about
6m43s in every CI job on a cold Nix cache. CI does not run dist (release.yml
installs its own), so the ci shell leaves it out. The default shell keeps it.

Refs furedea/reusable-workflows#23

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The ci shell leaves out cargo-dist, whose source build took about 6m43s in
every job on a cold Nix cache.

Refs furedea/reusable-workflows#23

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 9, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Review summary

I reviewed the changes to ci.yml, codex-conformance.yml and flake.nix and found no blocking problems.

  • Each job checks out the repo and runs nix-setup before any run: step, so the new default shell nix develop .#ci has a flake and Nix to use. all-green installs no Nix, and it correctly overrides the shell back to bash.
  • The new ci devShell is built from the same toolPackages list as default, leaving out only cargoDist. It is defined for every system, so nix flake check still covers it.
  • nix develop adds the outer PATH after its own, so the node_modules/.bin entry written to GITHUB_PATH (and so codex) is still found in later steps.
  • Job names and the needs list are unchanged, so required checks are not affected.

Two version changes are intentional and noted in the PR body: Rust drops from 1.99.1 to 1.95.0, and Bats from 1.13.0 to 1.12.0. The PR body says the cargo checks pass on 1.95.0. No conformance test sets a minimum Bats version.

Findings: none (P0/P1: 0).

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 782b0168f5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@furedea
furedea merged commit 757abca into main Nov 9, 2026
21 checks passed
@furedea
furedea deleted the ci/23-dev-shell branch November 9, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: remove the last unverified download (bats-action in agent-harness)

1 participant