+15
-2
@@ -11,8 +11,17 @@ inputs:
|
||||
description: "go_test 為 true 時執行的指令"
|
||||
default: "go vet ./... && go test ./test/"
|
||||
docker_build:
|
||||
description: "true=用 docker build 檢查 Dockerfile 建得起來"
|
||||
description: "true=用 docker build 檢查 Dockerfile 建得起來(映像檔標籤唯一,不會撞到 runner 上的舊映像檔)"
|
||||
default: "false"
|
||||
docker_run_args:
|
||||
description: "docker_build 之後實際執行容器的參數(entrypoint 的參數,每行一個);空=不執行"
|
||||
default: ""
|
||||
docker_run_options:
|
||||
description: "執行容器的 docker create 選項(每行一個,例如 --env=INPUT_TASK=resolve-channel)"
|
||||
default: ""
|
||||
docker_run_expect:
|
||||
description: "容器輸出必須包含的字串;空=只檢查結束碼"
|
||||
default: ""
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
@@ -30,4 +39,8 @@ runs:
|
||||
- name: 建置映像檔
|
||||
if: ${{ inputs.docker_build == 'true' }}
|
||||
shell: bash
|
||||
run: docker build -t "action-test:$GITHUB_SHA" .
|
||||
env:
|
||||
RUN_ARGS: ${{ inputs.docker_run_args }}
|
||||
RUN_OPTIONS: ${{ inputs.docker_run_options }}
|
||||
RUN_EXPECT: ${{ inputs.docker_run_expect }}
|
||||
run: bash "${{ github.action_path }}/docker-check.sh"
|
||||
|
||||
Reference in New Issue
Block a user