Skip to content

add codecov action and config file #1

add codecov action and config file

add codecov action and config file #1

Workflow file for this run

name: Build msmbuilder2022 codecov
on:
push:
branches:
- main
# ignore changes to docs
paths-ignore:
- ./docs/*
pull_request:
branches:
- main
# ignore changes to docs
paths-ignore:
- ./docs/*
workflow_dispatch:
jobs:
build-code:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 6
matrix:
python-version: ["3.12"]
include:
- os: ubuntu-latest
path: ~/.cache/pip
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: test
- name: Install required packages
run: |
conda config --add channels conda-forge
# conda install -yq conda-build jinja2 conda-verify
conda install -yq zlib
conda install h5py
python -m pip install --upgrade pip
# conda update conda-build
- name: Pip install
run: |
python -m pip install .
- name: Test with pytest
run: |
conda install -yq numdifftools hmmlearn
pip install pytest
pip install pytest-cov
mkdir ../../pkgs
cp -r msmbuilder/tests ../../pkgs/
cd ../../pkgs
python tests/data_init.py
pytest tests --cov=msmbuilder --cov-report=xml:coverage.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ../../pkgs/coverage.xml
fail_ci_if_error: True
verbose: True