Skip to content

Updates select interp #465

Updates select interp

Updates select interp #465

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
build:
name: Build (${{ matrix.python-version }} | ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
python-version: ["3.8", "3.9", "3.10"]
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache Linux/macOS (x86) Conda environment
if: ${{ runner.os != 'Windows' }}
uses: actions/cache@v3
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-py${{ matrix.python-version }}.yml') }}
- name: Cache Windows Conda environment
if: ${{ runner.os == 'Windows' }}
uses: actions/cache@v3
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-py${{ matrix.python-version }}-win.yml') }}
- name: Build and activate Linux/macOS Conda environment
if: ${{ runner.os != 'Windows' }}
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
python-version: ${{ matrix.python-version }}
channels: conda-forge, defaults # These need to be specified to use mamba
channel-priority: true
environment-file: ci/environment-py${{ matrix.python-version }}.yml
activate-environment: test-env-mac-unix
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Build and activate Windows Conda environment
if: ${{ runner.os == 'Windows' }}
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
python-version: ${{ matrix.python-version }}
channels: conda-forge, defaults # These need to be specified to use mamba
channel-priority: true
environment-file: ci/environment-py${{ matrix.python-version }}-win.yml
activate-environment: test-env-win
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install package in environment
shell: bash -l {0}
run: |
python -m pip install -e . --no-deps --force-reinstall
- name: Run tests
shell: bash -l {0}
run: |
pytest -sv --cov=./ --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false