update GitHub Actions workflow to test Wipertools and collect coverage #149
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: Test code | |
on: [pull_request, push] | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] # , macos-latest, windows-latest | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: "3.10" | |
name: Test Wipertools | |
steps: | |
- uses: actions/checkout@v4 | |
name: Clone repository | |
- name: Install Miniconda (Mambaforge) | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
auto-activate-base: true | |
show-channel-urls: true | |
channels: conda-forge,bioconda,defaults | |
python-version: ${{ env.PYTHON }} | |
environment-file: .devcontainer/environment.yml | |
- name: Run tests and collect coverage | |
shell: bash -el {0} | |
run: pytest --pyargs ./tests --cov-config=.coveragerc --cov=./wipertools --cov-report=xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
env_vars: OS,PYTHON | |
files: ./coverage.xml # optional | |
flags: pytest # optional | |
name: codecov-umbrella # optional | |
fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) |