Skip to content

ci: run Go tools from the flake dev shell - #7

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

furedea merged 3 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 の Go ツールを,flake の devShell から動かす形にする.手元と CI で同じ版になり,flake.lock で内容が固定される.

項目 変更前 変更後
devShell aarch64-darwin のみ aarch64-darwin と x86_64-linux
Go の準備 actions/setup-go nix-setup(reusable-workflows v1.3.0)
golangci-lint golangci-lint-action(v2.15.0 固定) devShell(flake.lock の版)
実行 shell: bash nix develop --command bash -eo pipefail {0}

job 名と all-green の needs は変えていない.

検証

ローカルの nix develop 内で,golangci-lint run,golangci-lint fmt --diff,go test -race -cover ./...,go mod tidy -diff,deadcode,govulncheck が通ることを確認した.nix flake check --all-systems --no-build --option allow-import-from-derivation false も通った.

CI の時間

変更前は main の run 42259359914,変更後はこの PR の最初の run 42621073133(Nix のキャッシュがまだなく,store を全部取得した初回).

job 変更前 変更後(初回)
lint 32 秒 51 秒
format 12 秒 35 秒
test 31 秒 59 秒
audit 33 秒 62 秒
最初の job の開始から all-green の開始まで 約 51 秒 約 1 分 5 秒(audit が最長)

job は並列なので,全体の待ち時間は約 14 秒延びた.PR の run はキャッシュを保存しないため,この数字は常に初回相当になる.main に入った後の run がキャッシュを保存し,それ以降の run で短くなる見込み.main での実測は merge 後に確認する.

レビューへの対応

claude-review の P3(all-green が Nix のない素の runner で動くのに,workflow の既定の shell が nix develop になる)は妥当だったので,all-green に defaults.run.shell: bash を足した(c05ff54).codex-review の指摘はなし.

Refs furedea/reusable-workflows#23

🤖 Generated with Claude Code

furedea and others added 2 commits November 9, 2026 21:39
CI will run the Go tools from this dev shell on Linux runners. Refs furedea/reusable-workflows#23

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Replace setup-go and golangci-lint-action with the nix-setup composite
action and run every step in nix develop.

Refs: furedea/reusable-workflows#23

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@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:41:44.284038Z c05ff54 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.

Comment thread .github/workflows/ci.yml
defaults:
run:
shell: bash
shell: nix develop --command bash -eo pipefail {0}

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] This workflow-level default shell now also applies to all-green, which runs on a bare ubuntu-latest with no checkout and no Nix. Today its only step is exit 1, so the job still fails when it should — but it fails because nix: command not found, not because of the exit 1. That hides why it failed, and any step added to that job later would break too. Consider moving this defaults.run.shell onto the Nix-using jobs (lint/format/test/audit), or setting defaults: run: shell: bash on all-green.

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.

Valid, fixed in the next commit: all-green now sets defaults.run.shell to bash, so a failure there reports the exit 1 and not a missing nix. It passed here only because its single step was skipped.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Review summary

No blocking findings (0 P0, 0 P1).

  • [P3] The workflow-level shell: nix develop ... default also applies to all-green, which has no Nix installed. The gate still fails when it should, but with a misleading nix: command not found error. See the inline comment.

Other checks:

  • The flake.nix change to genAttrs is correct. It adds an x86_64-linux devShell, so nix develop works on ubuntu-latest. It keeps GOTOOLCHAIN=local and go_1_27, which matches go 1.27 in go.mod.
  • The job names and the needs list of all-green are unchanged, and every job that runs Go tools sets up Nix first.
  • The nix-setup action (v1.3.0, pinned by SHA) was not inspected; I'm assuming it installs Nix with flakes enabled.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: c2271ea91b

ℹ️ 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".

The workflow default shell needs Nix, which all-green does not install,
so a failure there would print nix: command not found.

Refs: furedea/reusable-workflows#23

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@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

Review summary

No blocking findings.

What I checked:

  • Workflow-level defaults.run.shell: nix develop --command bash -eo pipefail {0} only applies to run: steps in this file's jobs. It does not reach the uses: reusable-workflow jobs (nix-lint, gha-lint, nix-check, etc.). all-green runs on a plain runner and now overrides the shell back to bash, so it no longer depends on Nix.
  • Behaviour under the new shell: -eo pipefail keeps the old bash fail-fast behaviour, so the deadcode step's [ -z "$out" ] check still fails the job when there is output.
  • flake.nix: genAttrs over aarch64-darwin and x86_64-linux keeps the darwin shell the same and adds the linux shell CI needs. GOTOOLCHAIN=local with go_1_27 matches go 1.27 in go.mod. mkShell includes a C toolchain, so go test -race (which needs cgo) still works.
  • golangci-lint version: it now comes from flake.lock (unstable) instead of a fixed v2.15.0, so the local hooks and CI use the same version.

Non-blocking note: actions/setup-go used to cache the Go module and build caches. These jobs now download modules on every run unless nix-setup caches them. This only affects speed, not correctness.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: c05ff54b7a

ℹ️ 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 84773fb into main Nov 9, 2026
18 checks passed
@furedea
furedea deleted the ci/23-dev-shell branch November 9, 2026 14:07
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