Skip to content

Commit

Permalink
GHA concurrency (#6210)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronspring committed Jan 31, 2022
1 parent aab856b commit b09de81
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 54 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/cancel-duplicate-runs.yaml

This file was deleted.

23 changes: 4 additions & 19 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,14 @@ on:
- "*"
workflow_dispatch: # allows you to trigger manually

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

jobs:
skip-duplicate-jobs:
runs-on: ubuntu-latest
if: |
github.repository == 'pydata/xarray'
&& (github.event_name == 'push' || github.event_name == 'pull_request')
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v3.4.1
with:
# For workflows which are triggered concurrently with the same
# contents, attempt to execute them exactly once.
concurrent_skipping: 'same_content_newer'
paths_ignore: '["**/doc/**"]'
detect-ci-trigger:
name: detect ci trigger
runs-on: ubuntu-latest
needs: skip-duplicate-jobs
if: ${{ needs.skip-duplicate-jobs.outputs.should_skip != 'true' }}
outputs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
Expand Down Expand Up @@ -129,8 +116,6 @@ jobs:
doctest:
name: Doctests
runs-on: "ubuntu-latest"
needs: skip-duplicate-jobs
if: ${{ needs.skip-duplicate-jobs.outputs.should_skip != 'true' }}
defaults:
run:
shell: bash -l {0}
Expand Down
24 changes: 4 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,13 @@ on:
- "*"
workflow_dispatch: # allows you to trigger manually

jobs:
skip-duplicate-jobs:
runs-on: ubuntu-latest
if: |
github.repository == 'pydata/xarray'
&& (github.event_name == 'push' || github.event_name == 'pull_request')
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v3.4.1
with:
# For workflows which are triggered concurrently with the same
# contents, attempt to execute them exactly once.
concurrent_skipping: 'same_content_newer'
paths_ignore: '["**/doc/**"]'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
detect-ci-trigger:
name: detect ci trigger
needs: skip-duplicate-jobs
if: ${{ needs.skip-duplicate-jobs.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
outputs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
Expand Down Expand Up @@ -125,8 +111,6 @@ jobs:

event_file:
name: "Event File"
needs: skip-duplicate-jobs
if: ${{ needs.skip-duplicate-jobs.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Upload
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
- cron: "0 0 * * *" # Daily “At 00:00” UTC
workflow_dispatch: # allows you to trigger the workflow run manually

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

jobs:
detect-ci-trigger:
name: detect upstream-dev ci trigger
Expand Down

0 comments on commit b09de81

Please sign in to comment.