Skip to content

Commit

Permalink
update CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Jul 4, 2024
1 parent 2e50abe commit a528afe
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 27 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,36 @@ 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
- uses: actions/checkout@v4
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
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/climpred_installs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,44 @@ 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'
strategy:
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'
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.9"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- 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 .
Expand Down
29 changes: 19 additions & 10 deletions .github/workflows/climpred_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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)
Expand All @@ -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: |
Expand All @@ -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)
Expand All @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-production-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-staging-testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upstream-dev-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit a528afe

Please sign in to comment.