Skip to content

Commit 346a822

Browse files
authored
CI: Skip intermediate jobs, in order to save CI time (#152)
1 parent 5c29025 commit 346a822

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.github/workflows/example.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
defaults:
1212
run:
1313
shell: bash
14+
concurrency:
15+
# Skip intermediate builds: all builds except for builds on the `main` branch
16+
# Cancel intermediate builds: only pull request builds
17+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/main' || github.run_number }}
18+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1419
jobs:
1520
example:
1621
runs-on: ${{ matrix.os }}

.github/workflows/multiple_prs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ on:
99
defaults:
1010
run:
1111
shell: bash
12+
concurrency:
13+
# Skip intermediate builds: all builds except for builds on the `main` branch
14+
# Cancel intermediate builds: only pull request builds
15+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/main' || github.run_number }}
16+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1217
jobs:
1318
multiple_prs:
1419
runs-on: ubuntu-latest

.github/workflows/single_pr.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ on:
99
defaults:
1010
run:
1111
shell: bash
12+
concurrency:
13+
# Skip intermediate builds: all builds except for builds on the `main` branch
14+
# Cancel intermediate builds: only pull request builds
15+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/main' || github.run_number }}
16+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1217
jobs:
1318
update_each_manifest:
1419
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)