From ce100456c7e490cae3a15c1b3a701955e9b1b0af Mon Sep 17 00:00:00 2001 From: Illviljan <14371165+Illviljan@users.noreply.github.com> Date: Wed, 26 Apr 2023 07:07:21 +0200 Subject: [PATCH 1/4] Allow label run-upstream to run upstream CI --- .github/workflows/upstream-dev-ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index c7ccee73414..33891bbb766 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -41,6 +41,7 @@ jobs: && ( (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') || needs.detect-ci-trigger.outputs.triggered == 'true' + || contains( github.event.pull_request.labels.*.name, 'run-upstream') ) defaults: run: From 2f88a4a1966e619797ce53d33519d6081451078a Mon Sep 17 00:00:00 2001 From: Illviljan <14371165+Illviljan@users.noreply.github.com> Date: Wed, 26 Apr 2023 07:14:10 +0200 Subject: [PATCH 2/4] Update upstream-dev-ci.yaml --- .github/workflows/upstream-dev-ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 33891bbb766..11ded390ae2 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -6,6 +6,7 @@ on: pull_request: branches: - main + types: [opened, reopened, synchronize, labeled] schedule: - cron: "0 0 * * *" # Daily “At 00:00” UTC workflow_dispatch: # allows you to trigger the workflow run manually From 051dc36bcaf1e4fbb14be35b74247d357e155c21 Mon Sep 17 00:00:00 2001 From: Illviljan <14371165+Illviljan@users.noreply.github.com> Date: Wed, 26 Apr 2023 17:56:01 +0200 Subject: [PATCH 3/4] Add mypy upstream test --- .github/workflows/upstream-dev-ci.yaml | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 11ded390ae2..64f44fc315e 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -94,3 +94,58 @@ jobs: uses: xarray-contrib/issue-from-pytest-log@v1 with: log-path: output-${{ matrix.python-version }}-log.jsonl + + mypy-upstream-dev: + name: mypy-upstream-dev + runs-on: ubuntu-latest + needs: detect-ci-trigger + if: | + always() + && ( + contains( github.event.pull_request.labels.*.name, 'run-upstream') + ) + defaults: + run: + shell: bash -l {0} + strategy: + fail-fast: false + matrix: + python-version: ["3.10"] + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history for all branches and tags. + - name: Set up conda environment + uses: mamba-org/provision-with-micromamba@v15 + with: + environment-file: ci/requirements/environment.yml + environment-name: xarray-tests + extra-specs: | + python=${{ matrix.python-version }} + pytest-reportlog + conda + - name: Install upstream versions + run: | + bash ci/install-upstream-wheels.sh + - name: Install xarray + run: | + python -m pip install --no-deps -e . + - name: Version info + run: | + conda info -a + conda list + python xarray/util/print_versions.py + - name: Install mypy + run: | + python -m pip install mypy --force-reinstall + - name: Run mypy + run: | + python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report + - name: Upload mypy coverage to Codecov + uses: codecov/codecov-action@v3.1.3 + with: + file: mypy_report/cobertura.xml + flags: mypy + env_vars: PYTHON_VERSION + name: codecov-umbrella + fail_ci_if_error: false \ No newline at end of file From 3e136a01d1f4409adfaa52b507931360839f9984 Mon Sep 17 00:00:00 2001 From: Illviljan <14371165+Illviljan@users.noreply.github.com> Date: Wed, 26 Apr 2023 18:24:37 +0200 Subject: [PATCH 4/4] Update upstream-dev-ci.yaml --- .github/workflows/upstream-dev-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upstream-dev-ci.yaml b/.github/workflows/upstream-dev-ci.yaml index 64f44fc315e..ff7b633fcff 100644 --- a/.github/workflows/upstream-dev-ci.yaml +++ b/.github/workflows/upstream-dev-ci.yaml @@ -148,4 +148,4 @@ jobs: flags: mypy env_vars: PYTHON_VERSION name: codecov-umbrella - fail_ci_if_error: false \ No newline at end of file + fail_ci_if_error: false