-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trigger CI on push or pull_request but not both (#5142)
- Loading branch information
1 parent
176c6eb
commit a4df906
Showing
3 changed files
with
58 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,26 @@ on: | |
workflow_dispatch: # allows you to trigger manually | ||
|
||
jobs: | ||
detect-ci-trigger: | ||
name: detect ci trigger | ||
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: | ||
|
@@ -115,7 +129,8 @@ jobs: | |
doctest: | ||
name: Doctests | ||
runs-on: "ubuntu-latest" | ||
if: github.repository == 'pydata/xarray' | ||
needs: skip-duplicate-jobs | ||
if: ${{ needs.skip-duplicate-jobs.outputs.should_skip != 'true' }} | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,27 @@ on: | |
workflow_dispatch: # allows you to trigger manually | ||
|
||
jobs: | ||
detect-ci-trigger: | ||
name: detect ci trigger | ||
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 | ||
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 }} | ||
steps: | ||
|
@@ -110,6 +125,8 @@ 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,30 @@ on: | |
- completed | ||
|
||
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/**"]' | ||
|
||
publish-test-results: | ||
name: Publish test results | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.conclusion != 'skipped' | ||
needs: skip-duplicate-jobs | ||
if: | | ||
needs.skip-duplicate-jobs.outputs.should_skip != 'true' | ||
&& github.event.workflow_run.conclusion != 'skipped' | ||
steps: | ||
- name: Download and extract artifacts | ||
|