Repository navigation
XCL-201 agent-dev-kit に Supabase のマイグレーション・DB テストの再利用ワークフローを足す (kit 側) - #12
Merged
Merged
Conversation
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.
概要
Supabase を使うリポジトリに共通の CI (マイグレーション、DB テスト、ローカルの起動) を、kit の技術ごとの部品
stacks/supabase/にする。固有の点 (CLI の版、パス、除外するサービス、本番のブランチ、環境変数の名前) は入力にし、Secrets は明示的に受ける。変更内容
.github/workflows/stack-supabase-migrate.yml: マイグレーションに変更があるときだけ、PR で dry-run、本番のブランチへの push (と手動実行) で本番に適用する。Secrets (access_token・db_password・project_ref) はworkflow_call.secretsで受ける.github/workflows/stack-supabase-db-test.yml: 指定したパスに変更があるときだけ、ローカルの Supabase (native runtime) で pgTAP を実行し、出力のTarget: local stackで本番に繋いでいないことを確かめるstacks/supabase/actions/start-local/: ローカルの Supabase の起動。接続先を入れる環境変数の名前を入力にする (名前は検証してからGITHUB_ENVに書く)actions/changed) と起動のアクションは、job.workflow_repository・job.workflow_shaで kit の同じコミットを checkout して使うstacks/supabase/README.mdに前提・Secrets・呼び出し側の例を書き、kit の README の表と SETUP の §4 に案内を 1 行ずつ足す受け入れ条件
stack-supabase-migrate.yml・stack-supabase-db-test.yml・stack-supabase-keep-alive.ymlと、アクションstacks/supabase/actions/start-local/がある (keep-alive は範囲から外した。ほかはある)actions/changedで変更があるときだけ動くstacks/supabase/README.mdに、呼び出し側の例 (権限、Secrets、Variables) と前提を書き、kit の README の表に足す。kit の共通の文書 (SETUP の §1〜§8) には Supabase を前提にした手順を書かない動作確認
docker run --rm -v "$PWD:/repo" -w /repo rhysd/actionlint:1.7.12 -ignore 'workflow_(repository|sha)': 指摘 0 件node --test 'scripts/ci/*.test.mjs' 'ops/linear-janitor/*.test.mjs' 'ops/manager-precheck/*.test.mjs': 117 件すべて成功リスクの確認
.env*、キー、トークン) を含めていない人が確認すること
pushのジョブの条件 (github.ref == refs/heads/<production-branch>と push・手動実行) が意図どおりか補足
.github/にあったので、changedのパスにアクションとワークフローのファイルを入れていた。kit に移ると kit の版の変更は呼ぶ側の CI の入口のファイルの変更になるので、例ではpaths: supabase .github/workflows/ci.ymlにした。GITHUB_TOKENで checkout するので、kit が public である前提 (README に書いた)。