Repository navigation
ci: add the nix-check reusable workflow - #12
Conversation
Add a reusable workflow that runs nix flake check -L, call it from this repository's ci.yml, document it in the README, and allow its file name in ls-lint. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Review summary: No findings.
🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc466608a5
ℹ️ 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".
| uses: cachix/install-nix-action@75c75c31ebece974e48ebc36b4ad125bd97bd97b # v31.11.3 | ||
|
|
||
| - name: Run nix flake check | ||
| run: nix flake check -L |
There was a problem hiding this comment.
Validate every declared flake system
On this repository, ubuntu-latest makes the local system x86_64-linux, while flake.nix exposes only devShells.aarch64-darwin, so this command can succeed without evaluating the dev-shell derivation it was added to check. The Nix implementation skips outputs whose system differs from the local system unless --all-systems is enabled and even reports those outputs as omitted; pass --all-systems or run the check on matching runners so non-Linux-only flakes do not receive a false-green result.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
指摘のとおり,Linux ランナーでは他システムの出力が評価されず,偽の green になる点を修正します.ただし --all-systems 単体だと,他システム向けの checks(例: checks.aarch64-darwin)まで Linux ランナーでビルドしようとして失敗しうるため,2 ステップに分けました.(1) nix flake check -L でランナー自身の system の checks を評価・ビルドし,(2) nix flake check --all-systems --no-build で全 system の出力を評価だけして,何もビルドしません.これで aarch64-darwin のみの flake でも devShell の評価が検証されます.
On the Linux runner nix flake check skips outputs of other systems, so a flake that exposes only aarch64-darwin outputs passed without evaluating anything. Pass --all-systems to evaluate them. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…teps --all-systems may build other systems' checks on the Linux runner and fail. Build only the runner's own checks, then evaluate every system's outputs with --no-build. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
| run: nix flake check -L | ||
|
|
||
| - name: Evaluate every system | ||
| run: nix flake check --all-systems --no-build |
There was a problem hiding this comment.
P3: --no-build skips building the checks, but it does not stop builds that import-from-derivation (IFD) needs during evaluation. Suppose a calling repo's flake uses IFD (haskell.nix, crane/naersk in some setups, callCabal2nix, …) for aarch64-darwin. This step then tries to build darwin derivations on the Linux runner and fails with "a 'aarch64-darwin' with features {} is required". The workflow has no inputs, so that repo can't turn this step off. Consider adding a boolean input (e.g. all-systems, default true) so such repos can opt out.
There was a problem hiding this comment.
IFD を使う呼び出し元の flake は現時点で存在しないため,input は追加しません.IFD を使う flake が現れた時点で,boolean の input(例: all-systems,既定 true)を追加します.
Review summaryNo blocking findings (P0: 0, P1: 0, P2: 0, P3: 1).
🤖 Generated with Claude Code |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
概要
nix-check.ymlを追加し,flake の check を各リポジトリの CI で実行できるようにする.nix flake check -Lでランナー自身の system の checks を評価・ビルドし,nix flake check --all-systems --no-buildで全 system の出力を評価だけする.ci.ymlからも呼び出し,all-greenのneedsに加える.なぜ 2 ステップか
nix flake checkは,他 system の出力を評価しない.flake.nixがaarch64-darwinの出力しか持たないと,何も評価せずに green になる(Codex P2).--all-systems単体だと,他 system の checks(例:checks.aarch64-darwin)まで Linux ランナーでビルドしようとして失敗しうる.--no-buildで分けた.Before / After
nix-lint.ymlなどのみnix-check.ymlを追加ci.ymlflake checkを実行しないnix-checkを呼び出し,all-greenで待つ.ls-lint.ymlnix-checkのファイル名を許可しないnix-checkを許可レビュー指摘への対応
fd7e491)--no-buildでも darwin のビルドが走って失敗しうる.input で opt out できるようにする案true)を追加する検証
actionlintが指摘なしzizmorが指摘なしall-greenが green(fd7e491)claude-reviewとcodex-reviewの指摘をすべて処理(P2 は修正,P3 は上記のとおり見送りを返信)スコープ・除外・前提
.github/workflows/nix-check.yml(新規),ci.yml,README.md,.ls-lint.yml.nix-check: checkout(persist-credentials: false)→ install-nix-action → 上記 2 ステップ.permissions: {},ジョブはcontents: read,timeout-minutes: 20,defaults.run.shell: bash.入力なし.checks出力を持たないため,ステップ 1 は Linux ランナーでは評価対象が空になる.# zizmor: ignore[self-repository]付き(ci: switch local reusable workflow calls to the $/ syntax once actionlint supports it #10 参照).🤖 Generated with Claude Code