From 75166537ec21a39395ba51d39e58e310b39e1aa1 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 5 Oct 2026 21:00:35 +1300 Subject: [PATCH 1/2] Scope test workflows to the default branch. --- .github/workflows/test.yml | 2 ++ context/testing.md | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 366f886..2dabe0e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,9 @@ name: Test on: push: + branches: [main] pull_request: + branches: [main] workflow_dispatch: permissions: diff --git a/context/testing.md b/context/testing.md index 17bc7ce..0524e7e 100644 --- a/context/testing.md +++ b/context/testing.md @@ -160,12 +160,19 @@ regions. Passing not add a separate `cargo bake test` step to this job; the coverage task runs the tests itself. +Filter both `push` and `pull_request` to `main`. Pull request updates then run +through `pull_request`, without a duplicate run from the feature-branch push; +merging to `main` still runs the workflow after the merge. Keep +`workflow_dispatch` for manual runs. + ```yaml name: Test on: push: + branches: [main] pull_request: + branches: [main] workflow_dispatch: permissions: From 199a31080ec31e0559e995ef062860c8d5cfe338 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 5 Oct 2026 21:04:00 +1300 Subject: [PATCH 2/2] Document external test workflow branch filters. --- context/testing.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/context/testing.md b/context/testing.md index 0524e7e..f7c2fc9 100644 --- a/context/testing.md +++ b/context/testing.md @@ -207,12 +207,18 @@ External compatibility testing is optional. Add `.github/workflows/external.yml` only when the Cargo metadata list contains one or more selected downstream repositories: +Use the same event filters as `test.yml`: pull requests targeting `main` and +pushes to `main`. This prevents duplicate downstream test runs for a pull +request branch while still checking the merged default branch. + ```yaml name: External Tests on: push: + branches: [main] pull_request: + branches: [main] workflow_dispatch: permissions: