Skip to content

Commit

Permalink
Allow GitHub Actions to cancel in-progress workflows
Browse files Browse the repository at this point in the history
Also ensures job names match concurrency group names
  • Loading branch information
colinrotherham committed Nov 19, 2023
1 parent 8a8d2ea commit bf20a74
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ on:

workflow_dispatch:

concurrency:
group: integration-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
test-saucelabs:
integration:
name: Build & test
runs-on: ubuntu-latest

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/saucelabs.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Cross-browser tests

# Our Sauce Labs account only allows 5 tests to run at a time.
concurrency: saucelabs

on:
pull_request:

Expand All @@ -12,8 +9,11 @@ on:

workflow_dispatch:

# Our Sauce Labs account only allows 5 tests to run at a time.
concurrency: saucelabs

jobs:
test-saucelabs:
saucelabs:
name: Build & test (with Sauce Labs)
runs-on: ubuntu-latest
timeout-minutes: 15
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ on:

workflow_dispatch:

concurrency:
group: tests-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
test:
name: Build & basic tests
runs-on: ubuntu-latest

Expand Down

0 comments on commit bf20a74

Please sign in to comment.