Skip to content

ci: add the nix-check reusable workflow - #12

Merged
furedea merged 3 commits into
mainfrom
ci/add-nix-check-workflow
Nov 7, 2026
Merged

furedea merged 3 commits into
mainfrom
ci/add-nix-check-workflow

Conversation

@furedea-agent

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

Copy link
Copy Markdown
Contributor

概要

  • 共有 reusable workflow nix-check.yml を追加し,flake の check を各リポジトリの CI で実行できるようにする.
  • 2 ステップ構成:nix flake check -L でランナー自身の system の checks を評価・ビルドし,nix flake check --all-systems --no-build で全 system の出力を評価だけする.
  • このリポジトリの ci.yml からも呼び出し,all-green の needs に加える.

なぜ 2 ステップか

  • Linux ランナーの nix flake check は,他 system の出力を評価しない.flake.nix が aarch64-darwin の出力しか持たないと,何も評価せずに green になる(Codex P2).
  • --all-systems 単体だと,他 system の checks(例:checks.aarch64-darwin)まで Linux ランナーでビルドしようとして失敗しうる.
  • そこで,ビルドはランナー自身の system に限り,全 system の評価は --no-build で分けた.

Before / After

項目 Before After
共有ワークフロー nix-lint.yml などのみ nix-check.yml を追加
このリポジトリの ci.yml flake check を実行しない nix-check を呼び出し,all-green で待つ
.ls-lint.yml nix-check のファイル名を許可しない nix-check を許可

レビュー指摘への対応

指摘 内容 対応
Codex P2 Linux ランナーでは aarch64-darwin のみの flake が評価されず,偽の green になる 2 ステップ構成に変更(fd7e491)
claude-review P3 IFD を使う flake では --no-build でも darwin のビルドが走って失敗しうる.input で opt out できるようにする案 対応しない.IFD を使う呼び出し元は現時点でなく,その flake が現れた時点で boolean の input(既定 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 ステップ.
  • 設定:workflow 全体は permissions: {},ジョブは contents: read,timeout-minutes: 20,defaults.run.shell: bash.入力なし.
  • 除外:キャッシュ(実測 40〜70 秒.遅くなった時点で追加する).IFD 向けの opt-out input(上記 P3).
  • このリポジトリの flake は checks 出力を持たないため,ステップ 1 は Linux ランナーでは評価対象が空になる.
  • ローカル呼び出しは # zizmor: ignore[self-repository] 付き(ci: switch local reusable workflow calls to the $/ syntax once actionlint supports it #10 参照).
  • Issue はなく,この PR 本文が目的を示す.

🤖 Generated with Claude Code

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]>
@furedea

furedea commented Nov 7, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 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-07T07:14:54.790410Z fd7e491 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 7, 2026

Copy link
Copy Markdown

Review summary: No findings.

nix-check.yml follows the same pattern as nix-lint.yml: the same action pins, permissions: {} at the workflow level with contents: read on the job, persist-credentials: false, and a timeout. The self-call in ci.yml and the all-green needs entry are wired correctly. This repo has a flake.nix and flake.lock, so the new job has something to check. The .ls-lint.yml change is needed because the base regex doesn't allow hyphens. I found no correctness or security problems. Skipping the cache seems reasonable at the measured run times.

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

指摘のとおり,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 の評価が検証されます.

furedea and others added 2 commits November 7, 2026 16:10
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]>
@furedea

furedea commented Nov 7, 2026

Copy link
Copy Markdown
Owner

@codex review

run: nix flake check -L

- name: Evaluate every system
run: nix flake check --all-systems --no-build

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IFD を使う呼び出し元の flake は現時点で存在しないため,input は追加しません.IFD を使う flake が現れた時点で,boolean の input(例: all-systems,既定 true)を追加します.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

Review summary

No blocking findings (P0: 0, P1: 0, P2: 0, P3: 1).

  • nix-check.yml uses the same pins, permissions and persist-credentials: false as nix-lint.yml. The ci.yml call and the all-green needs entry are set up correctly. The .ls-lint.yml and README updates match the change.
  • This repo's flake.nix only defines aarch64-darwin. On the Linux runner, nix flake check -L therefore builds nothing, so the useful check here is the --all-systems --no-build evaluation.
  • P3 (inline): if a calling repo's flake uses import-from-derivation, --all-systems --no-build can still try to build other systems' derivations and fail on the Linux runner. An opt-out input would let such repos turn that step off.
  • Minor: the PR body describes a single nix flake check -L step, but the workflow runs two steps. The README already describes both.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: fd7e49199d

ℹ️ 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 17aff19 into main Nov 7, 2026
13 checks passed
@furedea
furedea deleted the ci/add-nix-check-workflow branch November 7, 2026 07:46
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.

1 participant