From be6758886dba1334df08ca1d3fd6c45df0dd97a2 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Wed, 27 Apr 2022 19:14:11 -0700 Subject: [PATCH 1/5] Attempt to consolidate tests in CI --- .github/workflows/ci-additional.yaml | 3 +++ .github/workflows/ci.yaml | 22 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-additional.yaml b/.github/workflows/ci-additional.yaml index c43dd1ad46a..f2def509a68 100644 --- a/.github/workflows/ci-additional.yaml +++ b/.github/workflows/ci-additional.yaml @@ -30,6 +30,9 @@ jobs: with: keyword: "[skip-ci]" + # This job is deprecated and can be removed soon. It's still here in case the + # move consolidate with `ci.yaml` missed something which the existing test + # picks up. test: name: ${{ matrix.os }} ${{ matrix.env }} runs-on: ${{ matrix.os }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0f8073c017b..5467455c1dd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,6 +43,17 @@ jobs: os: ["ubuntu-latest", "macos-latest", "windows-latest"] # Bookend python versions python-version: ["3.8", "3.10"] + include: + # Minimum python version: + - env: "py38-bare-minimum" + python-version: 3.8 + - env: "py38-min-all-deps" + python-version: 3.8 + # Latest python version: + - env: "py39-all-but-dask" + python-version: 3.9 + - env: "py39-flaky" + python-version: 3.9 steps: - uses: actions/checkout@v3 with: @@ -52,10 +63,16 @@ jobs: if [[ ${{ matrix.os }} == windows* ]] ; then echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV + elif [[ ${{ matrix.env }} == "py39-flaky" ]] ; + then + echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV + echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests" >> $GITHUB_ENV + elif [ -n ${{ matrix.env }} ] ; + echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV else echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV - fi + echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV - name: Cache conda @@ -87,14 +104,17 @@ jobs: conda info -a conda list python xarray/util/print_versions.py + - name: Import xarray run: | python -c "import xarray" + - name: Run tests run: python -m pytest -n 4 --cov=xarray --cov-report=xml --junitxml=pytest.xml + $PYTEST_EXTRA_FLAGS - name: Upload test results if: always() From 9b867fd790383448e404b04e04f27e30c9a4842f Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Wed, 27 Apr 2022 19:46:06 -0700 Subject: [PATCH 2/5] --- .github/workflows/ci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5467455c1dd..eac97adbec6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,13 +47,17 @@ jobs: # Minimum python version: - env: "py38-bare-minimum" python-version: 3.8 + os: ubuntu-latest - env: "py38-min-all-deps" python-version: 3.8 + os: ubuntu-latest # Latest python version: - env: "py39-all-but-dask" python-version: 3.9 + os: ubuntu-latest - env: "py39-flaky" python-version: 3.9 + os: ubuntu-latest steps: - uses: actions/checkout@v3 with: From 01c1e3acfd5c3253af5028664b5178e55a9c70a3 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Wed, 27 Apr 2022 19:50:19 -0700 Subject: [PATCH 3/5] --- .github/workflows/ci.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index eac97adbec6..6353178d629 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -67,12 +67,15 @@ jobs: if [[ ${{ matrix.os }} == windows* ]] ; then echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV - elif [[ ${{ matrix.env }} == "py39-flaky" ]] ; - then - echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV - echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests" >> $GITHUB_ENV elif [ -n ${{ matrix.env }} ] ; - echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV + then + if [[ ${{ matrix.env }} == "py39-flaky" ]] ; + then + echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV + echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests" >> $GITHUB_ENV + else + echo "CONDA_ENV_FILE=ci/requirements/${{ matrix.env }}.yml" >> $GITHUB_ENV + fi else echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV fi From aaedae4364e56d00d4bed88c39cf88a082a2b21d Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Wed, 27 Apr 2022 20:01:42 -0700 Subject: [PATCH 4/5] --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6353178d629..c506171d764 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -67,7 +67,7 @@ jobs: if [[ ${{ matrix.os }} == windows* ]] ; then echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV - elif [ -n ${{ matrix.env }} ] ; + elif [[ ${{ matrix.env }} != "" ]] ; then if [[ ${{ matrix.env }} == "py39-flaky" ]] ; then From 55427197f525267488d85a40faef2e4fbd31ade1 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Wed, 27 Apr 2022 20:04:18 -0700 Subject: [PATCH 5/5] --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c506171d764..749adb58a9b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -67,9 +67,9 @@ jobs: if [[ ${{ matrix.os }} == windows* ]] ; then echo "CONDA_ENV_FILE=ci/requirements/environment-windows.yml" >> $GITHUB_ENV - elif [[ ${{ matrix.env }} != "" ]] ; + elif [[ "${{ matrix.env }}" != "" ]] ; then - if [[ ${{ matrix.env }} == "py39-flaky" ]] ; + if [[ "${{ matrix.env }}" == "py39-flaky" ]] ; then echo "CONDA_ENV_FILE=ci/requirements/environment.yml" >> $GITHUB_ENV echo "PYTEST_EXTRA_FLAGS=--run-flaky --run-network-tests" >> $GITHUB_ENV