Skip to content

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

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

furedea merged 2 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 ツール(setup-go,golangci-lint-action)をやめ,flake の devShell から動かす形にする.Nix の準備は reusable-workflows の composite action nix-setup(v1.3.0)を使う.

項目 変更前 変更後
Go と golangci-lint setup-go,golangci-lint-action(v2.15.0) devShell(flake.lock で固定)
Nix の準備 nix-build ジョブだけ install-nix-action 全ジョブ nix-setup(Nix のインストールとキャッシュ)
実行シェル bash nix develop --command bash -eo pipefail {0}
  • flake.nix は変更なし.x86_64-linux の devShell と,CI に必要なツール(go_1_27,golangci-lint,go tool の govulncheck と deadcode)は既にある.
  • job 名と all-green の needs は変えていない.
  • nix-build は devShell が要らないので,nix run のステップだけ shell: bash.キャッシュは key-prefix: nix-build で分ける.
  • キャッシュの保存は lint だけが行う(同じキーでの保存競合を避けるため).format,test,audit は save: false.

Refs furedea/reusable-workflows#23

検証

  • nix flake check --all-systems --no-build --option allow-import-from-derivation false: 3 システムとも通過
  • nix develop 内で golangci-lint run,golangci-lint fmt --diff,go mod tidy -diff,go test -race -cover ./...,go tool deadcode ./...: すべて通過
  • go tool govulncheck: ローカルのサンドボックスでは脆弱性 DB に届かず未実行(CI で実行される)

CI の時間

全体(ci.yml の実行時間)
変更前(main の直近 5 回) 約 75〜110 秒(直近 93 秒)
変更後(この PR の初回,キャッシュなし) レビュー以外のジョブで最長 1 分 23 秒(test)

ジョブごと(変更後): lint 1:02,format 0:41,test 1:23,audit 1:07,nix-build 1:09,nix-check 1:22

  • 変更前の値は main への push の実行で,レビューのジョブを含まない.この PR の全体(3 分 49 秒)は codex-review(2 分 37 秒)を待つ時間なので比べない.
  • Nix のキャッシュは main への push でだけ保存する.この PR はキャッシュ保存前の値で,main に入れた後の実行は短くなる見込み.
  • 最長ジョブは変更前の全体と同程度で,待ち時間は大きく延びていない.

計画からの変更点

なし.

furedea and others added 2 commits November 9, 2026 21:39
Drop setup-go and golangci-lint-action; every job now sets up Nix with
the shared nix-setup action and runs its commands in `nix develop`.
The nix-build job uses nix-setup as well, with its own cache key prefix.

The nix-setup release SHA is still a placeholder (RELEASE_SHA).

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-09T12:59:21.898286Z fa5125d 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

Review summary

No P0, P1, P2 or P3 findings.

What I checked in .github/workflows/ci.yml:

  • Default shell: the new default is nix develop --command bash -eo pipefail {0}. Every job that falls back to it installs Nix first, and steps that run before Nix exists or don't need the dev shell set shell: bash explicitly (nix-build and all-green). This default does not apply to the steps inside the composite action or to the called reusable workflows.
  • Dev shell contents: it provides go_1_27 with GOTOOLCHAIN=local, which matches go 1.27 in go.mod. It also has unstable.golangci-lint, a v2 build that matches .golangci.yml version: "2". mkShell brings the stdenv C compiler, so cgo is available for go test -race.
  • Go tools: go tool govulncheck and go tool deadcode resolve through the tool directives in go.mod.
  • Unchanged structure: job names and the needs list of all-green are the same as before.

Limitations:

  • I couldn't read the pinned nix-setup action (2ae9532) from this sandbox, so I haven't checked how it handles the key-prefix and save inputs.
  • Dropping setup-go also drops its cache of Go modules and the build cache. This may make CI slower, which the timing measurement in the PR should show, but it doesn't affect correctness.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: fa5125dc20

ℹ️ 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 06ebbf6 into main Nov 9, 2026
19 checks passed
@furedea
furedea deleted the ci/23-dev-shell branch November 9, 2026 13:04
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