調整:所有版本號改成從 Gitea 變數取得
This commit is contained in:
@@ -5,7 +5,7 @@ action repo 的共用 CI:先 `shellcheck`,再(可選)在 `ci-env` 容器
|
|||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: https://gitea.jsc.idv.tw/actions/action-ci@v0.0.1
|
- uses: https://gitea.jsc.idv.tw/actions/action-ci@${{ vars.ACTION_ACTION_CI_VERSION }}
|
||||||
with:
|
with:
|
||||||
go_test: true
|
go_test: true
|
||||||
docker_build: true
|
docker_build: true
|
||||||
@@ -23,6 +23,6 @@ steps:
|
|||||||
|`docker_run_options`||執行容器的 `docker create` 選項(每行一個,例如 `--env=INPUT_TASK=x`)|
|
|`docker_run_options`||執行容器的 `docker create` 選項(每行一個,例如 `--env=INPUT_TASK=x`)|
|
||||||
|`docker_run_expect`||容器輸出必須包含的字串,空=只檢查結束碼|
|
|`docker_run_expect`||容器輸出必須包含的字串,空=只檢查結束碼|
|
||||||
|
|
||||||
不要對 Docker action 用 `uses: ./` 自測:這台 runner 會依名稱重用舊映像檔,可能跑到別的專案的映像檔。內部引用的 `shellcheck`、`ci-env` 版本寫死在 `action.yml`,升級要先發它們再發 `action-ci`。
|
不要對 Docker action 用 `uses: ./` 自測:這台 runner 會依名稱重用舊映像檔,可能跑到別的專案的映像檔。內部用的 `shellcheck`、`ci-env` 版本取自呼叫端 repo 的 Gitea 變數 `ACTION_SHELLCHECK_VERSION`、`ACTION_CI_ENV_VERSION`(不寫死在 `action.yml`),所以呼叫端要先設好這兩個變數。
|
||||||
|
|
||||||
圖示:`icon.svg`(頭像用 `icon.png`)。
|
圖示:`icon.svg`(頭像用 `icon.png`)。
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
name: action-ci
|
name: action-ci
|
||||||
description: "action repo 的共用 CI:shellcheck → Go 腳本測試(在 ci-env 容器裡,Go 版本取 go.mod)→ 建置映像檔。要在 checkout 之後使用,各步驟用輸入開關"
|
description: "action repo 的共用 CI:shellcheck → Go 腳本測試(在 ci-env 容器裡,Go 版本取 go.mod)→ 建置映像檔。內部用的 shellcheck、ci-env 版本取自呼叫端的 Gitea 變數 ACTION_SHELLCHECK_VERSION、ACTION_CI_ENV_VERSION。要在 checkout 之後使用,各步驟用輸入開關"
|
||||||
inputs:
|
inputs:
|
||||||
shellcheck_files:
|
shellcheck_files:
|
||||||
description: "shellcheck 要檢查的檔案(空白分隔,可用萬用字元);沒有符合的檔案就略過"
|
description: "shellcheck 要檢查的檔案(空白分隔,可用萬用字元);沒有符合的檔案就略過"
|
||||||
@@ -26,12 +26,12 @@ runs:
|
|||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: shellcheck
|
- name: shellcheck
|
||||||
uses: https://gitea.jsc.idv.tw/actions/shellcheck@v0.0.1
|
uses: https://gitea.jsc.idv.tw/actions/shellcheck@${{ vars.ACTION_SHELLCHECK_VERSION }}
|
||||||
with:
|
with:
|
||||||
files: ${{ inputs.shellcheck_files }}
|
files: ${{ inputs.shellcheck_files }}
|
||||||
- name: Go 測試
|
- name: Go 測試
|
||||||
if: ${{ inputs.go_test == 'true' }}
|
if: ${{ inputs.go_test == 'true' }}
|
||||||
uses: https://gitea.jsc.idv.tw/actions/ci-env@v0.0.2
|
uses: https://gitea.jsc.idv.tw/actions/ci-env@${{ vars.ACTION_CI_ENV_VERSION }}
|
||||||
env:
|
env:
|
||||||
GO_VERSION: go.mod
|
GO_VERSION: go.mod
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user