Skip to content

Commit

Permalink
Add Codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed May 16, 2024
1 parent 03b96bb commit 6248af6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: run tests
name: testsuite

on:
push:
Expand Down Expand Up @@ -34,8 +34,9 @@ jobs:
module restore pymbe
source venv/bin/activate
make pylint
make tests
make unit_tests COVERAGE=1
make docs
make coverage_xml
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
Expand All @@ -44,3 +45,14 @@ jobs:
name: documentation
retention-days: 2
if-no-files-found: error
- name: Upload coverage to Codecov
if: ${{ github.repository == 'pyMBE-dev/pyMBE' }}
uses: codecov/codecov-action@v4
with:
file: "./coverage.xml"
disable_search: true
env_vars: OS,PYTHON
fail_ci_if_error: false
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
.PHONY: visual
.PHONY: clean

# whether to run unit tests with code coverage
COVERAGE = 0

# output directory for the code coverage HTML files
COVERAGE_HTML = coverage

# Python executable or launcher, possibly with command line arguments
PYTHON = python3
ifeq ($(COVERAGE),1)
PYTHON := ${PYTHON} -m coverage run --parallel-mode --source=$(CURDIR)
endif

docs:
mkdir -p ./documentation
Expand All @@ -30,6 +40,15 @@ functional_tests:

tests: unit_tests functional_tests

coverage_xml:
${PYTHON} -m coverage combine .
${PYTHON} -m coverage report
${PYTHON} -m coverage xml

coverage_html:
${PYTHON} -m coverage combine .
${PYTHON} -m coverage html --directory="${COVERAGE_HTML}"

sample:
${PYTHON} samples/peptide.py

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# pyMBE: the Python-based Molecule Builder for ESPResSo

![GitHub Actions](https://github.com/pyMBE-dev/pyMBE/actions/workflows/testsuite.yml/badge.svg)
[![codecov](https://codecov.io/gh/pyMBE-dev/pyMBE/branch/codecov/graph/badge.svg)](https://codecov.io/gh/pyMBE-dev/pyMBE)

pyMBE provides tools to facilitate building up molecules with complex architectures in the Molecular Dynamics software [ESPResSo](https://espressomd.org/wordpress/). Some examples of molecules that can be set up with pyMBE are polyelectrolytes, peptides and proteins. pyMBE bookkeeps all the information about the molecule topology, permitting to link each particle to its corresponding residue and molecule. pyMBE uses the [Pint](https://pint.readthedocs.io/en/stable/) library to enable input parameters in any arbitrary unit system, which is later transformed in the reduced unit system used in ESPResSo.

## Dependencies
Expand Down

0 comments on commit 6248af6

Please sign in to comment.