Skip to content

Commit 9a6e89c

Browse files
authored
[Infra] Add GHA behavior where old workflows are cancelled when new commit is pushed to a PR (#9498)
* Add top-level concurrency context to all workflows * [will revert] Kill all workflows from previous commit * [skip ci] Revert "[will revert] Kill all workflows from previous commit" This reverts commit c6cf40a. * [skip ci] Don't cancel in progress for `generate_issues.yml` * Experiment with conditonal cancellation * [keep ci] this would be cool if it worked * Try again * [keep ci] try again * Undo experiment and try to cancel `health-metrics-*` * [skip ci] Revert `health-metrics-presubmit.yml`
1 parent c61018e commit 9a6e89c

38 files changed

+155
-0
lines changed

.github/workflows/abtesting.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
# Run every day at 1am(PST) - cron uses UTC times
1212
- cron: '0 9 * * *'
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519
pod-lib-lint:
1620
# Don't run on private repo unless it is a PR.

.github/workflows/analytics.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
# Run every day at 1am (PST) - cron uses UTC times
1313
- cron: '0 9 * * *'
1414

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
17+
cancel-in-progress: true
18+
1519
jobs:
1620
pod-lib-lint:
1721
# Don't run on private repo unless it is a PR.

.github/workflows/app_check.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
# Run every day at 11pm (PST) - cron uses UTC times
1010
- cron: '0 7 * * *'
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
pod_lib_lint:
1418
# Don't run on private repo unless it is a PR.

.github/workflows/appdistribution.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
# Run every day at 1am (PST) - cron uses UTC times
1111
- cron: '0 9 * * *'
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
pod-lib-lint:
1519
# Don't run on private repo unless it is a PR.

.github/workflows/archiving.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
# This is set to 3 hours after zip workflow finishes so zip testing can run after.
1010
- cron: '0 10 * * *'
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
# Archive tests for pods that support iOS only.
1418
pods-ios-only-cron:

.github/workflows/auth.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
# Run every day at 1am (PST) - cron uses UTC times
1212
- cron: '0 9 * * *'
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519

1620
pod-lib-lint:

.github/workflows/check.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
push:
88
branches: master
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
12+
cancel-in-progress: true
13+
1014
jobs:
1115
check:
1216
# Don't run on private repo.

.github/workflows/cocoapods-integration.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
# Run every day at 2am (PST) - cron uses UTC times
1111
- cron: '0 10 * * *'
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
tests:
1519
# Don't run on private repo unless it is a PR.

.github/workflows/combine.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ on:
4242
# Run every day at 11pm (PST) - cron uses UTC times
4343
- cron: '0 7 * * *'
4444

45+
concurrency:
46+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
47+
cancel-in-progress: true
48+
4549
jobs:
4650
xcodebuild:
4751
# Don't run on private repo unless it is a PR.

.github/workflows/core-diagnostics.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
# Run every day at 12am (PST) - cron uses UTC times
1313
- cron: '0 8 * * *'
1414

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
17+
cancel-in-progress: true
18+
1519
jobs:
1620
pod-lib-lint:
1721
# Don't run on private repo unless it is a PR.

.github/workflows/core.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
# Run every day at 2am (PST) - cron uses UTC times
1212
- cron: '0 10 * * *'
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519
pod-lib-lint:
1620
# Don't run on private repo unless it is a PR.

.github/workflows/crashlytics.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
# Run every day at 10am (PST) - cron uses UTC times
1313
- cron: '0 2 * * *'
1414

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
17+
cancel-in-progress: true
18+
1519
jobs:
1620

1721
pod-lib-lint:

.github/workflows/danger.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: danger
33
on:
44
pull_request
55

6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
8+
cancel-in-progress: true
9+
610
jobs:
711
danger:
812
runs-on: macos-11

.github/workflows/database.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
# Run every day at 2am (PST) - cron uses UTC times
1616
- cron: '0 10 * * *'
1717

18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
20+
cancel-in-progress: true
21+
1822
jobs:
1923
unit:
2024
# Don't run on private repo unless it is a PR.

.github/workflows/dynamiclinks.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
# Run every day at 1am (PST) - cron uses UTC times
1212
- cron: '0 9 * * *'
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519
pod_lib_lint:
1620
# Don't run on private repo unless it is a PR.

.github/workflows/firebasepod.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
# Run every day at 1am (PST) - cron uses UTC times
1414
- cron: '0 9 * * *'
1515

16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
18+
cancel-in-progress: true
19+
1620
jobs:
1721
installation-test:
1822
# Don't run on private repo unless it is a PR.

.github/workflows/firestore.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ on:
5959
# Run every day at 12am (PST) - cron uses UTC times
6060
- cron: '0 8 * * *'
6161

62+
concurrency:
63+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
64+
cancel-in-progress: true
65+
6266
jobs:
6367
check:
6468
# Don't run on private repo unless it is a PR.

.github/workflows/functions.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on:
1717
# Run every day at 1am (PST) - cron uses UTC times
1818
- cron: '0 9 * * *'
1919

20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
22+
cancel-in-progress: true
23+
2024
jobs:
2125

2226
pod-lib-lint:

.github/workflows/google-utilities-components.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010
# Run every day at 10pm (PST) - cron uses UTC times
1111
- cron: '0 6 * * *'
1212

13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
16+
cancel-in-progress: true
17+
1318
jobs:
1419
pod-lib-lint:
1520
# Don't run on private repo unless it is a PR.

.github/workflows/health-metrics-presubmit.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010
env:
1111
METRICS_SERVICE_SECRET: ${{ secrets.GHASecretsGPGPassphrase1 }}
1212

13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
16+
cancel-in-progress: true
17+
1318
jobs:
1419
# Check all the modified SDKs, the flags will be true if changed files match patterns in the file
1520
# scripts/health_metrics/file_patterns.json

.github/workflows/health-metrics-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
env:
88
gpg_passphrase: ${{ secrets.GHASecretsGPGPassphrase1 }}
99

10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
13+
cancel-in-progress: true
14+
1015
jobs:
1116
release-diffing:
1217
runs-on: ubuntu-latest

.github/workflows/inappmessaging.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
# Run every day at 10pm (PST) - cron uses UTC times
1212
- cron: '0 6 * * *'
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519

1620
pod_lib_lint:

.github/workflows/installations.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
# Run every day at 10pm (PST) - cron uses UTC times
1111
- cron: '0 6 * * *'
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
pod-lib-lint:
1519
# Don't run on private repo unless it is a PR.

.github/workflows/messaging.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on:
1717
# Run every day at 10pm (PST) - cron uses UTC times
1818
- cron: '0 6 * * *'
1919

20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
22+
cancel-in-progress: true
23+
2024
jobs:
2125

2226
messaging:

.github/workflows/mlmodeldownloader.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
# Run every day at 11pm (PST) - cron uses UTC times
1111
- cron: '0 7 * * *'
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
pod-lib-lint:
1519
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'

.github/workflows/performance-integration-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
# TODO: Validate when the timer starts after job is triggered.
1212
- cron: '0 */4 * * *'
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519

1620
# Public repository: Build and run the Integration Tests for the Firebase performance E2E Test App.

.github/workflows/performance.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ on:
1818
# Specified in format 'minutes hours day month dayofweek'
1919
- cron: '0 7 * * *'
2020

21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
23+
cancel-in-progress: true
24+
2125
jobs:
2226

2327
# Build and run the unit tests for Firebase performance SDK.

.github/workflows/prerelease.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
# Run every day at 11pm (PST) - cron uses UTC times
1010
- cron: '0 7 * * *'
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
buildup_SpecsTesting_repo:
1418
# Don't run on private repo unless it is a PR.

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
# Run every day at 11pm (PST) - cron uses UTC times
1111
- cron: '0 7 * * *'
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
buildup_SpecsTesting_repo:
1519
# Don't run on private repo unless it is a PR.

.github/workflows/remoteconfig.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
# Run every day at 12am (PST) - cron uses UTC times
1313
- cron: '0 8 * * *'
1414

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
17+
cancel-in-progress: true
18+
1519
jobs:
1620

1721
remoteconfig:

.github/workflows/shared-swift.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
# Run every day at 3am (PST) - cron uses UTC times
1111
- cron: '0 11 * * *'
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418

1519
pod-lib-lint:

.github/workflows/spectesting.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: spectesting
33
on:
44
pull_request
55

6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
8+
cancel-in-progress: true
9+
610
jobs:
711
specs_checking:
812
# Don't run on private repo unless it is a PR.

.github/workflows/spm.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on:
1717
# This workflow builds and tests the Swift Package Manager. Only iOS runs on PRs
1818
# because each platform takes 15-20 minutes after adding Firestore.
1919

20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
22+
cancel-in-progress: true
23+
2024
jobs:
2125
swift-build-run:
2226
# Don't run on private repo unless it is a PR.

.github/workflows/storage.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
# Run every day at 12am (PST) - cron uses UTC times
1414
- cron: '0 8 * * *'
1515

16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
18+
cancel-in-progress: true
19+
1620
jobs:
1721
storage:
1822
# Don't run on private repo unless it is a PR.

.github/workflows/symbolcollision.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
# Run every day at 12am (PST) - cron uses UTC times
1313
- cron: '0 8 * * *'
1414

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
17+
cancel-in-progress: true
18+
1519
jobs:
1620
installation-test:
1721
# Don't run on private repo unless it is a PR.

.github/workflows/update-cpp-sdk-on-release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
release:
88
types: [ published ]
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
12+
cancel-in-progress: true
13+
1014
jobs:
1115
trigger_cpp_sdk_update:
1216
# Only when a new release (not just the CocoaPods-* tag) is published.

0 commit comments

Comments
 (0)