ci: dev-shell のビルドを CI で自動検証するワークフローを追加する#307
Merged
Conversation
flake.nix に定義された devShells がビルド可能かを CI で検証できていなかった。 nix flake show で devShell 名を動的に取得し matrix に渡すことで、 新しい devShell を追加した際も CI 側の変更なしに自動追従する。 Co-authored-by: Claude Code <noreply@anthropic.com>
**/*.nix では無関係な .nix 変更でも CI が走り過剰だった。 devShells の定義は flake.nix に集約されているため、 トリガーを flake.nix と flake.lock に限定する。 Co-authored-by: Claude Code <noreply@anthropic.com>
root の flake.nix に devShells を定義すると templates と二重管理になる。 templates/ 配下の各 flake.nix を正本とし、root の devShells と それ専用だった rust-overlay input・pkgsWithRust・mkShellWithZsh を削除する。 CI も templates/ 配下を動的検出してビルド検証するよう変更し、 テンプレート追加時に CI 側の変更が不要になる構成にする。 Co-authored-by: Claude Code <noreply@anthropic.com>
root flake の devShells を削除し templates を正本にしたことで、 nix develop 'github:rito528/dotfiles#rust' 形式が使えなくなった。 該当セクションを削除し、direnv での直接参照方法を追記する。 テンプレート一覧はディレクトリを参照すればよいため記載しない。 また devshell.yaml の CI 説明も追加する。 Co-authored-by: Claude Code <noreply@anthropic.com>
プロジェクト固有の devShell のみ管理する方針に変更するため、 汎用テンプレートとそれに対応する flake.nix の templates 定義を削除する。 Co-authored-by: Claude Code <noreply@anthropic.com>
1 つの devShell のビルドが失敗しても他のジョブをキャンセルせず、 全テンプレートのビルド結果を一度に確認できるようにする。 Co-authored-by: Claude Code <noreply@anthropic.com>
terraform が BSL 1.1 ライセンスのため nixpkgs のデフォルト設定でビルドが拒否される。 allowUnfreePredicate で terraform のみ明示的に許可する。 Co-authored-by: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
flake.nixに 7 つの devShell が定義されているが、CI でビルド検証が行われていなかったnix flake show --jsonで devShell 名を動的に取得して matrix に展開する 2 ジョブ構成のワークフロー.github/workflows/devshell.yamlを追加したflake.nixに devShell を追加・削除しても CI 側の変更は不要確認事項
integration-test.yamlを踏襲しており(cachix・アクションバージョンを共通化)、設定ミスのリスクは低いnix flake show --json | jq -c '.devShells."x86_64-linux" | keys'の出力形式は実行済みで JSON 配列になることを確認済み補足
discoverジョブではnix flake show --json 2>/dev/nullとして stderr を捨てているため、警告が出ても出力が汚染されない🤖 Generated with Claude Code