Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81178aa5c1 | ||
|
|
c7878bb440 | ||
|
|
919817adec | ||
|
|
2cac19095b | ||
|
|
63ad33f2dc |
@@ -1,7 +1,5 @@
|
||||
name: ci
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}
|
||||
@@ -10,7 +8,7 @@ jobs:
|
||||
test:
|
||||
runs-on: docker-ubuntu
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }}
|
||||
- uses: ./
|
||||
with:
|
||||
checkout: false
|
||||
|
||||
@@ -25,7 +25,7 @@ steps:
|
||||
|
||||
不要對 Docker action 用 `uses: ./` 自測:這台 runner 會依名稱重用舊映像檔,可能跑到別的專案的映像檔。
|
||||
|
||||
內部用的 `shellcheck`、`ci-env` 版本取自呼叫端 repo 的 Gitea 變數 `ACTION_SHELLCHECK_VERSION`、`ACTION_CI_ENV_VERSION`(不寫死在 `action.yml`),所以呼叫端要先設好這兩個變數。
|
||||
內部用的版本都取自呼叫端 repo 的 Gitea 變數(不寫死在 `action.yml`),所以呼叫端要先設好:`ACTION_CHECKOUT_VERSION`、`ACTION_SHELLCHECK_VERSION`、`ACTION_CI_ENV_VERSION`,以及 shellcheck 工具本身的 `TOOL_SHELLCHECK_VERSION`(例如 `v0.10.0`)。
|
||||
|
||||
## 開發與發版
|
||||
|
||||
|
||||
+3
-2
@@ -1,5 +1,5 @@
|
||||
name: action-ci
|
||||
description: "action repo 的共用 CI:checkout → shellcheck → Go 腳本測試(有 go.mod 與 test/ 才跑,在 ci-env 容器裡,Go 版本取 go.mod)→ 建置映像檔(有 Dockerfile 才跑,可選擇實際執行並檢查輸出)。自動偵測,各 repo 的 ci.yaml 不必設開關。內部用的 shellcheck、ci-env 版本取自呼叫端的 Gitea 變數 ACTION_SHELLCHECK_VERSION、ACTION_CI_ENV_VERSION"
|
||||
description: "action repo 的共用 CI:checkout → shellcheck → Go 腳本測試(有 go.mod 與 test/ 才跑,在 ci-env 容器裡,Go 版本取 go.mod)→ 建置映像檔(有 Dockerfile 才跑,可選擇實際執行並檢查輸出)。自動偵測,各 repo 的 ci.yaml 不必設開關。版本都取自呼叫端的 Gitea 變數:ACTION_CHECKOUT_VERSION、ACTION_SHELLCHECK_VERSION、ACTION_CI_ENV_VERSION、TOOL_SHELLCHECK_VERSION(shellcheck 本身)"
|
||||
inputs:
|
||||
checkout:
|
||||
description: "true=先 checkout;false=呼叫端已經 checkout(例如要用 uses: ./ 測自己)"
|
||||
@@ -24,7 +24,7 @@ runs:
|
||||
steps:
|
||||
- name: checkout
|
||||
if: ${{ inputs.checkout == 'true' }}
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }}
|
||||
- name: 偵測
|
||||
id: detect
|
||||
shell: bash
|
||||
@@ -35,6 +35,7 @@ runs:
|
||||
uses: https://gitea.jsc.idv.tw/actions/shellcheck@${{ vars.ACTION_SHELLCHECK_VERSION }}
|
||||
with:
|
||||
files: ${{ inputs.shellcheck_files }}
|
||||
version: ${{ vars.TOOL_SHELLCHECK_VERSION }}
|
||||
- name: Go 測試
|
||||
if: ${{ steps.detect.outputs.go == 'true' }}
|
||||
uses: https://gitea.jsc.idv.tw/actions/ci-env@${{ vars.ACTION_CI_ENV_VERSION }}
|
||||
|
||||
Reference in New Issue
Block a user