From d09621fa11b1470f9859a2e3201741acd2ab5ec9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 5 Dec 2025 08:41:16 -0800 Subject: [PATCH] ci: cancel prior test runs for the same git ref This should save on CI quite a bit. This will cancel our GHA runs when you push to the same ref, except for `main`, where I want to make sure every commit is tested. --- .github/workflows/nix.yml | 5 +++++ .github/workflows/test.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 825cf52f5..f928ed5a5 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -1,5 +1,10 @@ on: [push, pull_request] name: Nix + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name != 'main' && github.ref || github.run_id }} + cancel-in-progress: true + jobs: required: name: "Required Checks: Nix" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 916745f58..20f674bab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,11 @@ on: name: Test +# We only want the latest commit to test for any non-main ref. +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name != 'main' && github.ref || github.run_id }} + cancel-in-progress: true + jobs: required: name: "Required Checks: Test"