Skip to content

Commit 4603c54

Browse files
ci: Cancel in progress workflows for PRs (#3537)
Cancel in progress workflow runs when pushing new commits to a PR to save CI computing time. Fixes GH-3213
1 parent fa38a2b commit 4603c54

File tree

6 files changed

+30
-0
lines changed

6 files changed

+30
-0
lines changed

.github/workflows/benchmarking.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ on:
2020
- 'scripts/ci-select-xcode.sh'
2121
- 'scripts/set-device-tests-environment.patch'
2222

23+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
26+
cancel-in-progress: true
27+
2328
jobs:
2429
build-benchmark-test-target:
2530
name: Build app and test runner

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ on:
1818
- Gemfile.lock
1919
- 'Package.swift'
2020

21+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
24+
cancel-in-progress: true
25+
2126
jobs:
2227
# We had issues that the release build was broken on main.
2328
# With this we catch potential issues already in the PR.

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ on:
99
schedule:
1010
- cron: '40 4 * * 6'
1111

12+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
1217
jobs:
1318
analyze:
1419
name: Analyze

.github/workflows/lint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ on:
2424
- 'Sentry.xcodeproj/**'
2525
- '*.podspec'
2626

27+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
28+
concurrency:
29+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
30+
cancel-in-progress: true
31+
2732
jobs:
2833
swift-lint:
2934
name: Swift Lint

.github/workflows/saucelabs-UI-tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ on:
1818
- 'Samples/iOS-Swift/iOS-Swift.xcodeproj/xcshareddata/xcschemes/iOS-SwiftUITests.xcscheme'
1919
- 'Samples/iOS-Swift/iOS-Swift.xcodeproj/xcshareddata/xcschemes/iOS-Swift.xcscheme'
2020

21+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
24+
cancel-in-progress: true
25+
2126
jobs:
2227
build-ui-tests:
2328
name: Build UITests

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ on:
2828
- "Samples/macOS-Swift/macOS-Swift.xcodeproj/xcshareddata/xcschemes/macOS-Swift.xcscheme"
2929
- "Samples/iOS-ObjectiveC/iOS-ObjectiveC.xcodeproj/xcshareddata/xcschemes/iOS-ObjectiveC.xcscheme"
3030

31+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
32+
concurrency:
33+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
34+
cancel-in-progress: true
35+
3136
jobs:
3237
build-test-server:
3338
name: Build test server

0 commit comments

Comments
 (0)