Change CI concurrency policy to not queue on main (#8530)
authorGereon Kremer <gkremer@cs.stanford.edu>
Fri, 1 Apr 2022 20:26:52 +0000 (22:26 +0200)
committerGitHub <noreply@github.com>
Fri, 1 Apr 2022 20:26:52 +0000 (13:26 -0700)
Previously, we would only allow one job per branch/PR and only cancel old jobs on PRs.
This PR changes this policy to allow multiple jobs at once on main.
The way this is done basically follows https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value.

.github/workflows/ci.yml

index 6173b741bd5907949c3deebd3b3f320cbf507054..9ef262784ef6f7fff64c37e64d49e9ec736b0058 100644 (file)
@@ -68,7 +68,7 @@ jobs:
 
     # cancel already running jobs for the same branch/pr/tag
     concurrency:
-      group: build-${{ github.ref }}-${{ matrix.name }}
+      group: build-${{ github.ref }}-${{ matrix.name }}-${{ github.ref != 'refs/heads/main' || github.run_id }}
       cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
 
     steps: