Skip to content

Commit

Permalink
Trigger upstream CI on cron schedule (by default) (#4729)
Browse files Browse the repository at this point in the history
Co-authored-by: keewis <keewis@users.noreply.github.com>
Co-authored-by: Keewis <keewis@posteo.de>
  • Loading branch information
3 people authored Jan 6, 2021
1 parent 31d540f commit bc49e27
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
- [ ] Passes `isort . && black . && mypy . && flake8`
- [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst`
- [ ] New functions/methods are listed in `api.rst`


<sub>By default, the upstream dev CI is disabled on pull request and push events. You can override this behavior per commit by adding a `[test-upstream]` tag to the first line of the commit message.</sub>
22 changes: 21 additions & 1 deletion .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,30 @@ on:
workflow_dispatch: # allows you to trigger the workflow run manually

jobs:
detect-ci-trigger:
name: detect upstream-dev ci trigger
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'pull_request'
outputs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/detect-ci-trigger
id: detect-trigger
with:
keyword: "[test-upstream]"

upstream-dev:
name: upstream-dev
runs-on: ubuntu-latest
if: github.repository == 'pydata/xarray'
needs: detect-ci-trigger
if: |
always()
&& github.repository == 'pydata/xarray'
&& (
(github.event_name == 'scheduled' || github.event_name == 'workflow_dispatch')
|| needs.detect-ci-trigger.outputs.triggered == 'true'
)
defaults:
run:
shell: bash -l {0}
Expand Down

0 comments on commit bc49e27

Please sign in to comment.