actions/composite-template: CI / BUILD (pull_request) Successful in 3s
actions/composite-template: CI / TEST (pull_request) Successful in 53s
actions/composite-template: CI / RESULT (pull_request) Successful in 3s
actions/ci: CI / BUILD (pull_request) Successful in 3s
workflows/ci: CI / BUILD (pull_request) Successful in 3s
actions/ci: CI / AI Code Review (pull_request) Successful in 2m13s
workflows/ci: CI / AI Code Review (pull_request) Successful in 49s
CI / TEST (pull_request) Successful in 1m7s
CI / RESULT (pull_request) Successful in 1s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
43 lines
3.0 KiB
Markdown
43 lines
3.0 KiB
Markdown
# setup-codex 工作流說明
|
||
|
||
本專案已改用共用工作流:共同的 CI / CD 流程由 `actions/composite-template` 的 `.gitea/scoped_workflows/`(Gitea scoped workflows 機制)自動套用到本 repo 執行,**不在本目錄內**。本目錄只保留 setup-codex 專屬的自測工作流,與共用流程並行執行。
|
||
|
||
## 工作流總覽
|
||
|
||
| 檔案 | 名稱 | 觸發條件 | 目的 |
|
||
| --- | --- | --- | --- |
|
||
| (共用)`composite-template/.gitea/scoped_workflows/ci.yaml` | `CI` | `pull_request`(`opened`、`synchronize`;目標分支 `master` / `develop`) | 版本計算、release 發佈、AI Code Review、舊 release 清理 |
|
||
| (共用)`composite-template/.gitea/scoped_workflows/master.yaml` | `CD` | `push` 到 `master` | 反查本次合併對應的 release tag |
|
||
| `.gitea/workflows/ci.yaml` | `CI`(自測) | `pull_request`(`opened`、`synchronize`;目標分支 `master` / `develop`),僅 base 為 `develop` 時執行 | 以本 repo 的 composite action 安裝 codex CLI 並實測 |
|
||
|
||
共用工作流的細節與 vars / secrets 需求,請見 `composite-template/.gitea/scoped_workflows/readme.md`。
|
||
|
||
## `.gitea/workflows/ci.yaml`
|
||
|
||
### Job:TEST — 安裝並實測 codex CLI(`if: gitea.base_ref == 'develop'`)
|
||
|
||
| 步驟 | 目的 |
|
||
| --- | --- |
|
||
| `Source Code Checkout` | 取出原始碼,讓 `uses: ./` 能找到本 repo 的 composite action |
|
||
| `Run Setup Codex` | 執行本 repo 根目錄的 composite action(即 setup-codex 自身),以 OAuth 憑證完成 codex CLI 安裝與認證 |
|
||
| `Execute Codex` | 執行 `codex exec "請你進行自我介紹"`,將多行回覆以 heredoc 寫入 step output `message`,驗證 CLI 可用 |
|
||
|
||
### Job:RESULT — 輸出 codex 回覆
|
||
|
||
| 步驟 | 目的 |
|
||
| --- | --- |
|
||
| `Show Message` | 將 TEST 輸出的 `message` 印到執行紀錄,確認輸出鏈串接成功(此步驟例外以 step 層 `env` 中轉,因 message 為多行且可能含特殊字元) |
|
||
|
||
### 參數
|
||
|
||
| 參數 | 優先權鏈 | 說明 |
|
||
| --- | --- | --- |
|
||
| 是否執行自測 | `gitea.base_ref == 'develop'` | 比照共用 CI 的 beta 判斷,僅 develop 的 PR 執行 |
|
||
| checkout 版本 | `vars.ACTION_CHECKOUT_VERSION` | 指定 `actions/checkout` 的 tag(組織層級已設定) |
|
||
| `oauth` | `secrets.CODEX_OAUTH` | codex CLI 的 OAuth 憑證(本 repo 專屬 secret,必須設定) |
|
||
|
||
## 備註
|
||
|
||
- 原本的 CI / CD 工作流(版本計算、release 發佈、AI Code Review、tag 反查)已刪除,其功能完全由共用工作流覆蓋;目前的 `ci.yaml` 是內容不同的自測流程,請勿在本目錄重新加入與共用流程重複的步驟,否則同一事件會重複執行(重複發 release、重複 AI review)。
|
||
- 自測與共用 CI 是兩條獨立的 workflow run,且顯示名稱同為 `CI`(Gitea 以檔案路徑識別,名稱重複不衝突;可由 job 組成區分——共用版為 `BUILD / TEST / RESULT`,自測只有 `TEST / RESULT`)。自測失敗不會擋下共用 CI 的 release 發佈,合併前請同時確認兩者的執行結果。
|