Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use built in run cancellation #742

Merged
merged 2 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
pull_request:
branches: ["*"]

concurrency:
group: check-release-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

Expand All @@ -14,6 +18,7 @@ jobs:
strategy:
matrix:
group: [check_release, link_check]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: "*"

concurrency:
group: downstream-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/enforce-label.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Enforce PR label

concurrency:
group: label-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
types: [labeled, unlabeled, opened, edited, synchronize]
Expand Down
26 changes: 4 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,15 @@ on:
push:
pull_request:

jobs:
check_duplicate_runs:
name: Check for duplicate runs
continue-on-error: true
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: always
cancel_others: true
skip_after_successful_duplicate: true
paths_ignore: '["**/README.md", "**/CHANGELOG.md", "**/COPYING.md"]'
do_not_skip: '["pull_request"]'
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
# Run "pre-commit run --all-files"
pre-commit:
name: Run pre-commit hook

needs: check_duplicate_runs
if: ${{ needs.check_duplicate_runs.outputs.should_skip != 'true' }}

runs-on: ubuntu-latest
timeout-minutes: 2

Expand Down Expand Up @@ -60,9 +45,6 @@ jobs:
build-n-test-n-coverage:
name: Build, test and code coverage

needs: check_duplicate_runs
if: ${{ needs.check_duplicate_runs.outputs.should_skip != 'true' }}

runs-on: ${{ matrix.os }}

strategy:
Expand Down