Refactoring for Python 3.12 #495
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: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "master" | |
pull_request: | |
branches: | |
- "*" | |
schedule: | |
- cron: "0 13 * * 1" | |
jobs: | |
build: | |
name: Build (${{ matrix.python-version }} | ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest"] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache conda | |
uses: actions/cache@v2 | |
env: | |
# Increase this value to reset cache if ci/environment.yml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment.yml') }} | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: test_env_xrft # Defined in ci/environment*.yml | |
auto-update-conda: false | |
python-version: ${{ matrix.python-version }} | |
environment-file: ci/environment.yml | |
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | |
- name: Set up conda environment | |
shell: bash -l {0} | |
run: | | |
python -m pip install -e . --no-deps | |
python -m ensurepip --upgrade | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade setuptools | |
conda list | |
- name: Run Tests | |
shell: bash -l {0} | |
run: | | |
pytest -n auto --cov=./ --cov-report=xml | |
- name: Upload code coverage to Codecov | |
uses: codecov/[email protected] | |
with: | |
file: ./coverage.xml | |
flags: unittests | |
env_vars: OS,PYTHON | |
name: codecov-umbrella | |
fail_ci_if_error: false |