Skip to content

add codecov action and config file #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
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
6 changes: 6 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ignore:
- "msmbuilder/tests"

comment:
layout: "reach, diff, flags, files"

Loading