Skip to content

Commit

Permalink
CI: limit concurrency for PR builds
Browse files Browse the repository at this point in the history
With this change, for each PR only the most recent version will be
tested by CI; if an update is pushed for the PR, any already running
tests for that PR are cancelled.

Some trickery is needed to ensure that for the master branch, concurrent
builds are still possible.
  • Loading branch information
fingolfin committed Nov 30, 2021
1 parent 652da3b commit 6bb9b6a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ on:
- push
- pull_request

concurrency:
# group by workflow and ref; the last slightly strange component ensures that for pull
# requests, we limit to 1 concurrent job, but for the master branch we don't
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }}
# Cancel intermediate builds, but only if it is a pull request build.
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }}
Expand Down

0 comments on commit 6bb9b6a

Please sign in to comment.