Skip to content

Tests

Tests #535

Workflow file for this run

name: Tests
on:
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.6", "3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v1
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('requirements.txt', 'requirements-dev.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
channels: conda-forge, defaults
channel-priority: true
python-version: ${{ matrix.python-version }}
activate-environment: gcm-filters-env
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- shell: bash -l {0}
run: mamba install --yes --file requirements.txt --file requirements-dev.txt
- name: Set up conda environment
shell: bash -l {0}
run: |
python -m pip install -e . --no-deps --force-reinstall
- name: Run Tests
shell: bash -l {0}
run: |
pytest --cov=./ --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false