33 lines
916 B
YAML
33 lines
916 B
YAML
name: ci
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
jobs:
|
|
test:
|
|
runs-on: docker-ubuntu
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: shellcheck
|
|
run: |
|
|
curl -fsSL https://github.com/koalaman/shellcheck/releases/download/v0.10.0/shellcheck-v0.10.0.linux.x86_64.tar.xz | tar -xJ -C "$RUNNER_TEMP" --strip-components=1
|
|
"$RUNNER_TEMP/shellcheck" -x -S warning ./*.sh
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
- name: 腳本黑箱測試
|
|
run: go vet ./... && go test ./test/
|
|
- id: ch
|
|
uses: ./
|
|
with:
|
|
task: resolve-channel
|
|
branch: dev
|
|
base_branch: main
|
|
main_branch: main
|
|
dev_branch: dev
|
|
- name: 檢查輸出
|
|
run: test "${{ steps.ch.outputs.channel }}" = release
|