Skip to content

Commit 6310957

Browse files
authored
Allow the label run-upstream to run upstream CI (#7787)
* Allow label run-upstream to run upstream CI * Update upstream-dev-ci.yaml * Add mypy upstream test * Update upstream-dev-ci.yaml
1 parent eec6f7b commit 6310957

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/upstream-dev-ci.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
pull_request:
77
branches:
88
- main
9+
types: [opened, reopened, synchronize, labeled]
910
schedule:
1011
- cron: "0 0 * * *" # Daily “At 00:00” UTC
1112
workflow_dispatch: # allows you to trigger the workflow run manually
@@ -41,6 +42,7 @@ jobs:
4142
&& (
4243
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
4344
|| needs.detect-ci-trigger.outputs.triggered == 'true'
45+
|| contains( github.event.pull_request.labels.*.name, 'run-upstream')
4446
)
4547
defaults:
4648
run:
@@ -92,3 +94,58 @@ jobs:
9294
uses: xarray-contrib/issue-from-pytest-log@v1
9395
with:
9496
log-path: output-${{ matrix.python-version }}-log.jsonl
97+
98+
mypy-upstream-dev:
99+
name: mypy-upstream-dev
100+
runs-on: ubuntu-latest
101+
needs: detect-ci-trigger
102+
if: |
103+
always()
104+
&& (
105+
contains( github.event.pull_request.labels.*.name, 'run-upstream')
106+
)
107+
defaults:
108+
run:
109+
shell: bash -l {0}
110+
strategy:
111+
fail-fast: false
112+
matrix:
113+
python-version: ["3.10"]
114+
steps:
115+
- uses: actions/checkout@v3
116+
with:
117+
fetch-depth: 0 # Fetch all history for all branches and tags.
118+
- name: Set up conda environment
119+
uses: mamba-org/provision-with-micromamba@v15
120+
with:
121+
environment-file: ci/requirements/environment.yml
122+
environment-name: xarray-tests
123+
extra-specs: |
124+
python=${{ matrix.python-version }}
125+
pytest-reportlog
126+
conda
127+
- name: Install upstream versions
128+
run: |
129+
bash ci/install-upstream-wheels.sh
130+
- name: Install xarray
131+
run: |
132+
python -m pip install --no-deps -e .
133+
- name: Version info
134+
run: |
135+
conda info -a
136+
conda list
137+
python xarray/util/print_versions.py
138+
- name: Install mypy
139+
run: |
140+
python -m pip install mypy --force-reinstall
141+
- name: Run mypy
142+
run: |
143+
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
144+
- name: Upload mypy coverage to Codecov
145+
uses: codecov/codecov-action@v3.1.3
146+
with:
147+
file: mypy_report/cobertura.xml
148+
flags: mypy
149+
env_vars: PYTHON_VERSION
150+
name: codecov-umbrella
151+
fail_ci_if_error: false

0 commit comments

Comments
 (0)