Skip to content

Unfix np2.4

Unfix np2.4 #833

name: xskillscore testing
on:
pull_request:
workflow_dispatch: # allows you to trigger manually
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
detect-ci-trigger:
name: detect ci trigger
runs-on: ubuntu-latest
outputs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
persist-credentials: false
- uses: xarray-contrib/ci-trigger@v1
id: detect-trigger
with:
keyword: "[skip-ci]"
test: # Runs testing suite on various python versions.
name: Test xskillscore (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:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up conda (micromamba)
uses: mamba-org/setup-micromamba@v2
with:
cache-downloads: true
cache-environment: true
environment-file: ci/minimum-tests.yml
create-args: >
python=${{ matrix.python-version }}
- name: Install minimal numpy
if: matrix.python-version == '3.9'
run: |
micromamba install numpy==1.24
- name: Run tests
run: |
pytest -n 4 --cov=xskillscore --cov-report=xml --verbose
- name: Upload coverage to codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: false
doctest: # Tests all docstrings
name: Doctests (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:
fail-fast: false
matrix:
python-version: [ "3.13" ]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up conda (micromamba)
uses: mamba-org/setup-micromamba@v2
with:
cache-downloads: true
cache-environment: true
environment-file: ci/minimum-tests.yml
create-args: >
python=${{ matrix.python-version }}
- name: Install xskillscore
run: |
python -m pip install --no-deps -e .
- name: Run doctests
run: |
python -m pytest --doctest-modules xskillscore --ignore xskillscore/tests
docs_notebooks: # Checks that pre-compiled notebooks in docs still work.
name: Test notebooks in docs (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:
persist-credentials: false
- name: Set up conda (micromamba)
uses: mamba-org/setup-micromamba@v2
with:
cache-downloads: true
cache-environment: true
environment-file: ci/docs_notebooks.yml
create-args: >
python=${{ matrix.python-version }}
- name: Install xskillscore
run: |
python -m pip install --no-deps -e .
- name: Test notebooks in docs
run: |
pushd docs
nbstripout source/*.ipynb
make -j4 html
popd