From 90bfcaa388c3f6b6aaca564a4e7f1266eac245eb Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 1 Jun 2026 14:39:09 -0400 Subject: [PATCH] ci: drop pull_request triggers + add cancel-in-progress concurrency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every commit on dev that's part of an open PR fires each workflow TWICE: once for the push event and once for the pull_request event (observable in run #43 + #44 for the same SHA in android.yml, same shape across test-web.yml and test-go.yml). The two runs check the exact same SHA — pure waste. Drop the pull_request trigger from test-web.yml, test-go.yml, and android.yml. The dev push already exercises every check that a PR would re-run. This repo has no fork PRs to cover, which is the only case pull_request would catch that push doesn't. Add a concurrency group keyed on workflow + ref with cancel-in-progress: true to every workflow including release.yml. Rapid re-pushes (or force-moving the per-day tag) now cancel the older in-flight run instead of stacking. --- .gitea/workflows/android.yml | 10 ++++++---- .gitea/workflows/release.yml | 7 +++++++ .gitea/workflows/test-go.yml | 17 ++++++----------- .gitea/workflows/test-web.yml | 20 ++++++++++++-------- 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/.gitea/workflows/android.yml b/.gitea/workflows/android.yml index e605379f..4d5aa939 100644 --- a/.gitea/workflows/android.yml +++ b/.gitea/workflows/android.yml @@ -17,10 +17,12 @@ on: paths: - 'android/**' - '.gitea/workflows/android.yml' - pull_request: - branches: [main] - paths: - - 'android/**' + +# pull_request trigger intentionally omitted — see test-web.yml for +# the rationale (single-author repo, push covers PR-merge equivalent). +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true env: # Silences the JDK 22+ "restricted method in java.lang.System has been diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 7b6c0376..9257c253 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -26,6 +26,13 @@ on: - '**/*.md' workflow_dispatch: +# Force-moving the per-day tag (or rapidly re-pushing to main) should +# supersede the in-flight build — the operator explicitly wants the +# later commit to win. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: release: runs-on: go-ci diff --git a/.gitea/workflows/test-go.yml b/.gitea/workflows/test-go.yml index 9b7a0f55..3f6d349f 100644 --- a/.gitea/workflows/test-go.yml +++ b/.gitea/workflows/test-go.yml @@ -31,17 +31,12 @@ on: - 'cmd/**' - '.golangci.yml' - '.gitea/workflows/test-go.yml' - pull_request: - branches: [main] - paths: - - '**/*.go' - - 'go.mod' - - 'go.sum' - - 'sqlc.yaml' - - 'internal/**' - - 'cmd/**' - - '.golangci.yml' - - '.gitea/workflows/test-go.yml' + +# pull_request trigger intentionally omitted — see test-web.yml for +# the rationale (single-author repo, push covers PR-merge equivalent). +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: test: diff --git a/.gitea/workflows/test-web.yml b/.gitea/workflows/test-web.yml index 1cf5d5d7..9893608d 100644 --- a/.gitea/workflows/test-web.yml +++ b/.gitea/workflows/test-web.yml @@ -1,8 +1,10 @@ name: test-web -# Web SPA: vitest + svelte-check. Runs on push to dev/main and PRs to -# main, scoped to web/** changes only — Go-only or Flutter-only diffs -# don't trigger this workflow. +# Web SPA: vitest + svelte-check. Runs on push to dev/main only — +# the `pull_request` trigger is intentionally omitted because every +# branch on this repo is local-only (no fork PRs), so the dev push +# fully covers what a PR run would re-execute. Keeping both events +# doubled CI cost on every commit. on: push: @@ -10,11 +12,13 @@ on: paths: - 'web/**' - '.gitea/workflows/test-web.yml' - pull_request: - branches: [main] - paths: - - 'web/**' - - '.gitea/workflows/test-web.yml' + +# Cancel an earlier in-flight run for the same ref when a newer +# commit arrives. With cancel-in-progress, rapid re-pushes don't +# pile up zombie runs. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: test: