chore(CI): 將 workflow 移至 .gitea/workflows 並改為安裝驗證流程
composite-actions/template: CI / BUILD (pull_request) Failing after 5s
CI / TEST (pull_request) Failing after 17s

This commit is contained in:
Jeffery
2026-07-17 12:52:10 +08:00
parent 4d4d87f1cf
commit 39a3e6c94b
2 changed files with 48 additions and 39 deletions
+48
View File
@@ -0,0 +1,48 @@
# ============================================================================
# 用途:本 CI workflow 於對 master 或 develop 發出 Pull Request(開啟或更新)時觸發,
# checkout 原始碼後以本 repo 的 composite action 安裝工具,並取得工具版本號驗證安裝。
# 更新時間:2026/07/17 12:38:20
# ============================================================================
# workflow 名稱,顯示於 Gitea Actions 介面
name: CI
# 觸發條件設定區塊
on:
# 針對 Pull Request 事件觸發
pull_request:
# 僅當 PR 目標分支為下列分支時觸發
branches:
- master
- develop
# 僅在 PR 開啟(opened)或有新 commit 更新(synchronize)時觸發
types: [opened, synchronize]
# 全域環境變數,供各 job/step 引用
env:
# 是否為 beta:當 PR 目標分支為 develop 時為 true
IS_BETA: ${{ gitea.base_ref == 'develop' }}
# 工作(job)定義區塊
jobs:
# test job:驗證本 composite action 能正確安裝工具
test:
# job 顯示名稱
name: TEST
# 執行環境(runner 標籤)
runs-on: ubuntu
# 依序執行的步驟清單
steps:
# 取出原始碼,供後續以本地 action(./)安裝工具
- name: 取得存取庫資訊
# 使用 checkout action,版本由 vars.ACTION_CHECKOUT_VERSION 決定
uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }}
# 引用本 repo 根目錄的 composite action 安裝工具
# 需人工確認:本 action 的 oauth 為必填輸入,此處未傳入;實際執行需以 with: oauth: ${{ secrets.ANTIGRAVITY_OAUTH_B64 }} 傳入
- name: 安裝工具
# uses: ./ 代表使用本 repo 內的 action.yml
uses: ./
# 取得工具版本號以驗證安裝成功
# 需人工確認:agy 安裝於 ~/.local/bin,若未在 PATH 上需先加入(例如寫入 $GITHUB_PATH
- name: 取得工具版本號
# 執行 Antigravity CLIagy)的版本查詢指令
run: agy --version