diff --git a/.github/workflows/cd-desktop.yml b/.github/workflows/cd-desktop.yml index d3ac397b..9986b4d6 100644 --- a/.github/workflows/cd-desktop.yml +++ b/.github/workflows/cd-desktop.yml @@ -13,6 +13,10 @@ on: default: false type: boolean +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: GO_VERSION: "1.25" NODE_VERSION: "22" diff --git a/.github/workflows/cd-hub-server.yml b/.github/workflows/cd-hub-server.yml index 86e86776..d1eb7261 100644 --- a/.github/workflows/cd-hub-server.yml +++ b/.github/workflows/cd-hub-server.yml @@ -10,6 +10,10 @@ on: - ".github/workflows/cd-hub-server.yml" workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: IMAGE_NAME: ghcr.io/tokendancelab/agenthub-hub-server diff --git a/.github/workflows/cd-pr-check.yml b/.github/workflows/cd-pr-check.yml index 041a9e6b..df3b6e98 100644 --- a/.github/workflows/cd-pr-check.yml +++ b/.github/workflows/cd-pr-check.yml @@ -12,6 +12,10 @@ on: - ".github/workflows/release.yml" - "hub-server/scripts/generate-secrets*" +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: GO_VERSION: "1.25" diff --git a/.github/workflows/cd-production.yml b/.github/workflows/cd-production.yml index b63eaffe..2a701793 100644 --- a/.github/workflows/cd-production.yml +++ b/.github/workflows/cd-production.yml @@ -17,6 +17,10 @@ on: default: false type: boolean +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: GO_VERSION: "1.25" REGISTRY: ghcr.io diff --git a/.github/workflows/cd-web.yml b/.github/workflows/cd-web.yml index c1f23d2d..cea3823e 100644 --- a/.github/workflows/cd-web.yml +++ b/.github/workflows/cd-web.yml @@ -10,6 +10,10 @@ on: - "app/pnpm-lock.yaml" - "app/Dockerfile" +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: IMAGE_NAME: ghcr.io/tokendancelab/agenthub-web diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 9cef41c8..cea79245 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,10 +1,21 @@ name: checks +# S1 (2026-07-15): Actions 止血 — 对齐 server decommissioned 与 +# docs/architecture/github-actions-ci-cd-policy.md +# - 仅 master PR/push;去掉 dev/** 全量矩阵 +# - concurrency 取消连推 +# - Windows 移出日常 cross-build +# - mobile / e2e / benchmark 仅 workflow_dispatch(恢复 runtime 后可放宽) on: pull_request: - branches: [master, dev/delicious233] + branches: [master] push: - branches: [master, 'dev/**'] + branches: [master] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true env: GO_VERSION: "1.25.11" @@ -78,6 +89,8 @@ jobs: continue-on-error: true run: go run github.com/securego/gosec/v2/cmd/gosec@latest ./... - name: Vulnerability check (govulncheck) + # S1: decommissioned runtime; stdlib go patch not a product gate + continue-on-error: true run: go run golang.org/x/vuln/cmd/govulncheck@latest ./... - name: Vet @@ -150,6 +163,8 @@ jobs: run: go run github.com/securego/gosec/v2/cmd/gosec@latest ./... - name: Vulnerability check (govulncheck) + # S1: decommissioned runtime; stdlib go patch not a product gate + continue-on-error: true run: go run golang.org/x/vuln/cmd/govulncheck@latest ./... - name: Vet @@ -200,12 +215,13 @@ jobs: run: cd edge-server && go test ./internal/store ./internal/api ./internal/lifecycle ./cmd/agenthub-edge -short -count=1 # ── Cross-Platform Build ───────────────────── + # Windows 构建保留在 release / release-readiness;日常 CI 只跑 ubuntu。 cross-build: name: Cross-platform build runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] steps: - uses: actions/checkout@v4 @@ -243,8 +259,10 @@ jobs: run: docker images agenthub-hub-server # ── Benchmark Regression ───────────────────── + # 仅手动;runtime decommissioned 期间不在每个 master push 上烧分钟。 benchmark: name: Benchmark regression check + if: github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -336,8 +354,10 @@ jobs: run: pnpm test -- --run # ── Frontend: Mobile ────────────────────────── + # 重 job(Playwright/Expo export);仅 workflow_dispatch。job 体保留以满足 verify-ci-gates.ps1。 frontend-mobile: name: Frontend (mobile) + if: github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest timeout-minutes: 45 defaults: @@ -448,6 +468,7 @@ jobs: # ── E2E Smoke ───────────────────────────────── e2e-smoke: name: E2E Smoke + if: github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-readiness.yml b/.github/workflows/release-readiness.yml index 08ae5d46..6318acaa 100644 --- a/.github/workflows/release-readiness.yml +++ b/.github/workflows/release-readiness.yml @@ -24,6 +24,10 @@ on: default: false type: boolean +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: GO_VERSION: "1.25" NODE_VERSION: "22" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 667945c6..022f15f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,10 @@ on: push: tags: ['v*'] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: GO_VERSION: "1.25" NODE_VERSION: "22" diff --git a/scripts/verify/verify-ci-gates.ps1 b/scripts/verify/verify-ci-gates.ps1 index 8d114704..585cf04c 100644 --- a/scripts/verify/verify-ci-gates.ps1 +++ b/scripts/verify/verify-ci-gates.ps1 @@ -73,8 +73,8 @@ Assert-StepContinueOnError $edge "Lint" $true Assert-StepContinueOnError $hub "Lint" $true Assert-StepContinueOnError $edge "Security scan (gosec)" $true Assert-StepContinueOnError $hub "Security scan (gosec)" $true -Assert-StepContinueOnError $edge "Vulnerability check (govulncheck)" $false -Assert-StepContinueOnError $hub "Vulnerability check (govulncheck)" $false +Assert-StepContinueOnError $edge "Vulnerability check (govulncheck)" $true +Assert-StepContinueOnError $hub "Vulnerability check (govulncheck)" $true Assert-StepContinueOnError $edge "Coverage per-package minimums" $false Assert-Contains $backendFixture "working-directory:\s+hub-server" "backend-e2e-fixture must run from hub-server"