Skip to content

Commit 267a78b

Browse files
committed
CI: tweak concurrency limiting
1 parent f16abe8 commit 267a78b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/CI.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,24 @@ name: CI
22

33
# Trigger the workflow on push or pull request
44
on:
5-
- push
6-
- pull_request
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
10+
# the `concurrency` settings ensure that not too many CI jobs run in parallel
11+
concurrency:
12+
# group by workflow and ref; the last slightly strange component ensures that for pull
13+
# requests, we limit to 1 concurrent job, but for the master branch we don't
14+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }}
15+
# Cancel intermediate builds, but only if it is a pull request build.
16+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
717

818
jobs:
919
# The CI test job
1020
test:
1121
name: ${{ matrix.gap-branch }}
1222
runs-on: ubuntu-latest
13-
# Don't run this twice on PRs for branches pushed to the same repository
14-
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }}
1523
strategy:
1624
fail-fast: false
1725
matrix:
@@ -35,8 +43,6 @@ jobs:
3543
manual:
3644
name: Build manuals
3745
runs-on: ubuntu-latest
38-
# Don't run this twice on PRs for branches pushed to the same repository
39-
if: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }}
4046

4147
steps:
4248
- uses: actions/checkout@v2

0 commit comments

Comments
 (0)