Regridding masks, robustness of dataset_utils functions and bug fixes #969
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CLISOPS Testing Suite | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
concurrency: | |
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch except on master. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
env: | |
ESGF_TEST_DATA_VERSION: v1 | |
XCLIM_TEST_DATA_VERSION: v2024.8.23 | |
permissions: | |
contents: read | |
jobs: | |
lint: | |
name: Linting Suite | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
tox-env: | |
- lint | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
- name: Set up Python${{ matrix.python-version }} | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
with: | |
python-version: "3.9" | |
cache: pip | |
- name: Install tox | |
run: | | |
python -m pip install tox~=4.18.0 | |
- name: Environment Caching | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
path: | | |
.tox | |
key: ${{ runner.os }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}-lint-${{ env.ESGF_TEST_DATA_VERSION }} | |
- name: Run linting suite | |
run: | | |
python -m tox -e ${{ matrix.tox-env }} | |
pypi: | |
name: Python${{ matrix.python-version }} (PyPI + Tox) | |
needs: lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
include: | |
- python-version: "3.9" | |
tox-env: py39 | |
- python-version: "3.10" | |
tox-env: py310 | |
- python-version: "3.11" | |
tox-env: py311 | |
- python-version: "3.12" | |
tox-env: py312 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
- name: Set up Python${{ matrix.python-version }} | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Install tox | |
run: | | |
python -m pip install tox~=4.18.0 | |
- name: Environment Caching | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
path: | | |
~/.cache/mini-esgf-data | |
~/.cache/xclim-testdata | |
.tox | |
key: ${{ runner.os }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}-Python${{ matrix.python-version }}-${{ env.ESGF_TEST_DATA_VERSION }} | |
- name: Test with tox | |
run: | | |
python -m tox -e ${{ matrix.tox-env }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_FLAG_NAME: run-${{ matrix.tox-env }} | |
COVERALLS_PARALLEL: true | |
COVERALLS_SERVICE_NAME: github | |
conda: | |
name: Python${{ matrix.python-version }} (Anaconda, upstream=${{ matrix.upstream }}) | |
needs: lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- python-version: "3.9" | |
upstream: false | |
- python-version: "3.10" | |
upstream: false | |
- python-version: "3.11" | |
upstream: false | |
# - python-version: "3.12" # Not yet available until https://github.com/pydata/xarray/issues/7794 is resolved | |
# upstream: false | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }} | |
uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1.9.0 | |
with: | |
cache-downloads: true | |
cache-environment: true | |
environment-file: environment.yml | |
create-args: >- | |
python=${{ matrix.python-version }} | |
micromamba-version: "1.5.10-0" # pinned to avoid the breaking changes with mamba and micromamba (2.0.0). | |
- name: Install CLISOPS | |
run: | | |
python -m pip install --no-user --editable ".[dev]" | |
- name: Install upstream dependencies | |
if: ${{ matrix.upstream }} | |
run: | | |
python -m pip install -r requirements_upstream.txt | |
- name: Test Data Caching | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
path: | | |
~/.cache/mini-esgf-data | |
~/.cache/xclim-testdata | |
key: ${{ runner.os }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}-conda-Python${{ matrix.python-version }}-${{ env.ESGF_TEST_DATA_VERSION }} | |
- name: Check versions | |
run: | | |
micromamba list | |
python -m pip check || true | |
pip install pytest-timeout | |
- name: Test with conda | |
run: | | |
python -m pytest -m "not slow" --timeout=180 --durations=10 --cov=clisops --cov-report=term-missing | |
finish: | |
needs: | |
- pypi | |
- conda | |
runs-on: ubuntu-latest | |
container: python:3-slim | |
steps: | |
- name: Coveralls Finished | |
run: | | |
python -m pip install --upgrade coveralls | |
coveralls --finish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_SERVICE_NAME: github |