From e5fb54cb72dcaf0b987cd1135c547532ef7bf875 Mon Sep 17 00:00:00 2001 From: dela Date: Mon, 25 May 2026 10:47:38 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E8=B5=B7=20GitHub=20Actions=20=E2=80=94?= =?UTF-8?q?=20build=20+=20vet=20+=20make=20guard=20+=20test-race?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 最小可跑 CI。ubuntu-latest + setup-go@v5 + Go 1.23,模块缓存开启。push/PR 到 main 触发;同 ref 并发取消;10 min 超时。不依赖 Docker / Postgres (集成测试留 testcontainers PR)。 闭掉 harness-health W3 partial 的前置条件之一。 --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..29fdc97 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: ci + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-test: + name: build + vet + guard + race + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.23' + cache: true + + - name: Download modules + run: go mod download + + - name: Build + run: go build ./... + + - name: Vet + run: go vet ./... + + - name: Guard (G1/G6/G11/G12/G13) + run: make guard + + - name: Test (race) + run: go test -race -timeout 5m ./...