From a528afe0b2c0df0d59eb7967e7daf6a15c094d72 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:57:20 -0400 Subject: [PATCH] update CI workflows --- .github/workflows/benchmarks.yml | 26 ++++++++++------- .github/workflows/climpred_installs.yml | 10 ++++--- .github/workflows/climpred_testing.yml | 29 ++++++++++++------- .github/workflows/publish-production-pypi.yml | 2 +- .../workflows/publish-staging-testpypi.yml | 2 +- .github/workflows/upstream-dev-ci.yml | 2 +- 6 files changed, 44 insertions(+), 27 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index c3b07ebbc..6aca49db1 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -10,10 +10,15 @@ jobs: benchmark: if: ${{ contains( github.event.pull_request.labels.*.name, 'run-benchmark') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} name: Linux - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: ASV_DIR: "./asv_bench" - + defaults: + run: + shell: bash -l {0} + strategy: + matrix: + python-version: ["3.10"] steps: # We need the full repo to avoid this issue # https://github.com/actions/checkout/issues/23 @@ -21,19 +26,20 @@ jobs: with: fetch-depth: 0 - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v3 + - name: Set up conda (micromamba) + uses: mamba-org/setup-micromamba@v1 with: - # installer-url: https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh - installer-url: https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh + environment-name: climpred-benchmarks + cache-environment: true + create-args: >- + python=${{ matrix.python-version }} + conda - - name: Setup some dependencies - shell: bash -l {0} + - name: Set Up Dependencies run: | - pip install asv + python -m pip install asv sudo apt-get update -y - name: Run benchmarks - shell: bash -l {0} id: benchmark env: OPENBLAS_NUM_THREADS: 1 diff --git a/.github/workflows/climpred_installs.yml b/.github/workflows/climpred_installs.yml index 40294610e..7b22c1589 100644 --- a/.github/workflows/climpred_installs.yml +++ b/.github/workflows/climpred_installs.yml @@ -25,7 +25,7 @@ jobs: keyword: "[skip-ci]" install-climpred-complete: # Installs climpred on various OS. - name: Install climpred[complete], ${{ matrix.os }} + name: Install climpred[complete], ${{ matrix.os }}, Python${{ matrix.python-version }} runs-on: ${{ matrix.os }} needs: detect-ci-trigger if: needs.detect-ci-trigger.outputs.triggered == 'false' @@ -33,19 +33,20 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] + python-version: ["3.9"] steps: - uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | pip install -e .[complete] python -c "import climpred" install-climpred: # Installs climpred on various OS. - name: Install climpred, ${{ matrix.os }} + name: Install climpred, ${{ matrix.os }}, Python${{ matrix.python-version }} runs-on: ${{ matrix.os }} needs: detect-ci-trigger if: needs.detect-ci-trigger.outputs.triggered == 'false' @@ -53,6 +54,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] + python-version: ["3.9"] steps: - uses: actions/checkout@v4 with: @@ -60,7 +62,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | pip install -e . diff --git a/.github/workflows/climpred_testing.yml b/.github/workflows/climpred_testing.yml index 7f84f6734..e6e0221a1 100644 --- a/.github/workflows/climpred_testing.yml +++ b/.github/workflows/climpred_testing.yml @@ -27,13 +27,16 @@ jobs: keyword: "[skip-ci]" minimum-test: # Runs testing suite with minimal dependencies - name: Test minimum dependencies, Python3.9 + name: Test minimum dependencies, Python${{ matrix.python-version }} runs-on: ubuntu-latest needs: detect-ci-trigger if: needs.detect-ci-trigger.outputs.triggered == 'false' defaults: run: shell: bash -l {0} + strategy: + matrix: + python-version: ["3.9"] steps: - uses: actions/checkout@v4 with: @@ -45,7 +48,7 @@ jobs: environment-name: climpred-minimum-tests cache-environment: true create-args: >- - python=3.9 + python=${{ matrix.python-version }} conda - name: Install climpred run: | @@ -96,9 +99,9 @@ jobs: environment-file: ci/requirements/maximum-tests.yml environment-name: climpred-maximum-tests cache-environment: true - cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" + cache-environment-key: "${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ env.TODAY }}-${{ hashFiles(env.CONDA_ENV_FILE) }}" create-args: >- - python=${{matrix.python-version}} + python=${{ matrix.python-version }} conda - name: Install climpred[complete] run: | @@ -128,11 +131,14 @@ jobs: fail_ci_if_error: false doctest: # tests all docstrings - name: Doctests, Python3.9 - runs-on: "ubuntu-latest" + name: Doctests, Python${{ matrix.python-version }} + runs-on: ubuntu-latest defaults: run: shell: bash -l {0} + strategy: + matrix: + python-version: ["3.9"] steps: - uses: actions/checkout@v4 - name: Setup conda (micromamba) @@ -142,7 +148,7 @@ jobs: environment-name: climpred-maximum-tests cache-environment: true create-args: >- - python=3.9 + python=${{ matrix.python-version }} conda - name: Install climpred[complete] run: | @@ -156,14 +162,17 @@ jobs: conda list - name: Run doctests run: | - python -m pytest --doctest-modules climpred --ignore climpred/tests + python -m pytest --doctest-modules src/climpred --ignore src/climpred/tests notebooks: # Checks that pre-compiled notebooks in docs still work. - name: Notebooks, Python3.9 + name: Notebooks, Python${{ matrix.python-version }} runs-on: ubuntu-latest defaults: run: shell: bash -l {0} + strategy: + matrix: + python-version: ["3.9"] steps: - uses: actions/checkout@v4 - name: Set up conda (micromamba) @@ -173,7 +182,7 @@ jobs: environment-name: climpred-docs cache-environment: true create-args: >- - python=3.9 + python=${{ matrix.python-version }} conda - name: Install climpred run: | diff --git a/.github/workflows/publish-production-pypi.yml b/.github/workflows/publish-production-pypi.yml index ca775f328..8988b16e1 100644 --- a/.github/workflows/publish-production-pypi.yml +++ b/.github/workflows/publish-production-pypi.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Python3 uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: "3.x" - name: Install packaging libraries run: | python -m pip install --upgrade pip diff --git a/.github/workflows/publish-staging-testpypi.yml b/.github/workflows/publish-staging-testpypi.yml index 17042ef3a..822cba1c8 100644 --- a/.github/workflows/publish-staging-testpypi.yml +++ b/.github/workflows/publish-staging-testpypi.yml @@ -34,7 +34,7 @@ jobs: - name: Set up Python3 uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: "3.x" - name: Install packaging libraries run: | python -m pip install --upgrade pip diff --git a/.github/workflows/upstream-dev-ci.yml b/.github/workflows/upstream-dev-ci.yml index 953433c31..7b6bf1c56 100644 --- a/.github/workflows/upstream-dev-ci.yml +++ b/.github/workflows/upstream-dev-ci.yml @@ -28,7 +28,7 @@ jobs: keyword: "[test-upstream]" upstream-dev: - name: upstream-dev + name: upstream-dev, Python${{ matrix.python-version }} runs-on: ubuntu-latest needs: detect-ci-trigger if: |