初始版本
ci / test (push) Canceled after 16s

This commit is contained in:
bot
2026-11-05 03:16:37 +00:00
commit 1b7bd3926b
5 changed files with 74 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
name: action-ci
description: "action repo 的共用 CI:shellcheck → Go 腳本測試(在 ci-env 容器裡,Go 版本取 go.mod)→ 建置映像檔。要在 checkout 之後使用,各步驟用輸入開關"
inputs:
shellcheck_files:
description: "shellcheck 要檢查的檔案(空白分隔,可用萬用字元);沒有符合的檔案就略過"
default: "*.sh"
go_test:
description: "true=跑 Go 測試"
default: "false"
go_test_command:
description: "go_test 為 true 時執行的指令"
default: "go vet ./... && go test ./test/"
docker_build:
description: "true=用 docker build 檢查 Dockerfile 建得起來"
default: "false"
runs:
using: composite
steps:
- name: shellcheck
uses: https://gitea.jsc.idv.tw/actions/shellcheck@v0.0.1
with:
files: ${{ inputs.shellcheck_files }}
- name: Go 測試
if: ${{ inputs.go_test == 'true' }}
uses: https://gitea.jsc.idv.tw/actions/ci-env@v0.0.2
env:
GO_VERSION: go.mod
with:
command: ${{ inputs.go_test_command }}
- name: 建置映像檔
if: ${{ inputs.docker_build == 'true' }}
shell: bash
run: docker build -t "action-test:$GITHUB_SHA" .