Skip to content

Commit

Permalink
add codecov action and config file
Browse files Browse the repository at this point in the history
  • Loading branch information
MingyiXue committed Oct 8, 2024
1 parent 0ffec01 commit 2a4af29
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
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"

0 comments on commit 2a4af29

Please sign in to comment.