Merge pull request '調整:第三方 action 與工具的版本也從 Gitea 變數取得' (#2) from chore/third-party-versions into main
ci / test (push) Successful in 4s
ci / test (push) Successful in 4s
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
@@ -10,7 +10,7 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: docker-ubuntu
|
runs-on: docker-ubuntu
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }}
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
checkout: false
|
checkout: false
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ steps:
|
|||||||
|
|
||||||
不要對 Docker action 用 `uses: ./` 自測:這台 runner 會依名稱重用舊映像檔,可能跑到別的專案的映像檔。
|
不要對 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
|
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:
|
inputs:
|
||||||
checkout:
|
checkout:
|
||||||
description: "true=先 checkout;false=呼叫端已經 checkout(例如要用 uses: ./ 測自己)"
|
description: "true=先 checkout;false=呼叫端已經 checkout(例如要用 uses: ./ 測自己)"
|
||||||
@@ -24,7 +24,7 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
if: ${{ inputs.checkout == 'true' }}
|
if: ${{ inputs.checkout == 'true' }}
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }}
|
||||||
- name: 偵測
|
- name: 偵測
|
||||||
id: detect
|
id: detect
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -35,6 +35,7 @@ runs:
|
|||||||
uses: https://gitea.jsc.idv.tw/actions/shellcheck@${{ vars.ACTION_SHELLCHECK_VERSION }}
|
uses: https://gitea.jsc.idv.tw/actions/shellcheck@${{ vars.ACTION_SHELLCHECK_VERSION }}
|
||||||
with:
|
with:
|
||||||
files: ${{ inputs.shellcheck_files }}
|
files: ${{ inputs.shellcheck_files }}
|
||||||
|
version: ${{ vars.TOOL_SHELLCHECK_VERSION }}
|
||||||
- name: Go 測試
|
- name: Go 測試
|
||||||
if: ${{ steps.detect.outputs.go == 'true' }}
|
if: ${{ steps.detect.outputs.go == 'true' }}
|
||||||
uses: https://gitea.jsc.idv.tw/actions/ci-env@${{ vars.ACTION_CI_ENV_VERSION }}
|
uses: https://gitea.jsc.idv.tw/actions/ci-env@${{ vars.ACTION_CI_ENV_VERSION }}
|
||||||
|
|||||||
Reference in New Issue
Block a user