Skip to content

Tests

Tests #581

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.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Create conda environment
uses: mamba-org/setup-micromamba@v1
with:
cache-downloads: true
cache-environment: true
micromamba-version: 'latest'
environment-file: ci/environment.yml
create-args: |
python=${{ matrix.python-version }}
cache-key: micromamba-${{ matrix.python-version }}-${{ runner.os }}
- name: Conda info
run: conda info
- name: Install gcm-filters
shell: micromamba-shell {0}
run: |
python -V
python -m pip install -e . --force-reinstall
- name: Run Tests
shell: bash -l {0}
run: |
python -V
coverage run --rcfile=coverage.toml -m pytest --verbose tests/*
- name: Get coverage report
shell: bash -l {0}
run: |
coverage report -m
coverage xml
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
fail_ci_if_error: false