Skip to content

GHA concurrency #6210

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

Merged
merged 10 commits into from
Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from 7 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
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/[email protected]
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')
Comment on lines -14 to -16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aaronspring, we may want to keep this condition so as to avoid running the CI on forks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn’t we keep this? @max-sixty @andersy005

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should! @aaronspring, can you open a new PR for that?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I merged too early. @aaronspring if you can open a PR then great, otherwise I can as penance

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put the condition in detect-ci-trigger in #6223

outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
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