Skip to content

Commit

Permalink
Add code coverage analysis by Codecov (duartegroup#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas authored Mar 29, 2024
1 parent cd35f02 commit 99e251c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 8 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ jobs:
run: ./install_gap.sh

- name: Test basic install
run: pytest
run: pytest --cov

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
flags: python-${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
slug: duartegroup/mlp-train


test-mace:
Expand Down Expand Up @@ -70,4 +77,11 @@ jobs:
run: ./install_mace.sh

- name: Test MACE install
run: pytest
run: pytest --cov

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
flags: python-${{ matrix.python-version }}-mace
token: ${{ secrets.CODECOV_TOKEN }}
slug: duartegroup/mlp-train
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dist/
*DS_store
**/__pycache__/
**/__MACOSX/
.coverage
.pytest_cache
.coverage*
.pytest_cache
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Test with pytest](https://github.com/duartegroup/mlp-train/actions/workflows/pytest.yml/badge.svg?event=push)](https://github.com/duartegroup/mlp-train/actions/workflows/pytest.yml)
[![pytest CI](https://github.com/duartegroup/mlp-train/actions/workflows/pytest.yml/badge.svg?event=push)](https://github.com/duartegroup/mlp-train/actions/workflows/pytest.yml)
[![codecov](https://codecov.io/gh/duartegroup/mlp-train/branch/main/graph/badge.svg)](https://codecov.io/gh/duartegroup/mlp-train)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![License](https://img.shields.io/badge/License-MIT%202.0-blue.svg)](https://opensource.org/licenses/mit)
Expand Down
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ dependencies:
- dscribe=2.0
- matplotlib-base
- numpy
- pytest
- pytest=8
- pytest-cov=5
- py-plumed
- scipy
- xtb
Expand Down
3 changes: 2 additions & 1 deletion environment_ace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ dependencies:
- dscribe=2.0
- matplotlib-base
- numpy
- pytest
- pytest=8
- pytest-cov=5
- py-plumed
- scipy
- xtb
Expand Down
3 changes: 2 additions & 1 deletion environment_mace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ dependencies:
- dscribe=2.0
- matplotlib-base
- numpy
- pytest
- pytest=8
- pytest-cov=5
- py-plumed
- scipy
- xtb
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ line-length = 79

[tool.ruff.format]
quote-style = "single"

[tool.pytest.ini_options]
addopts = "--cov-report term --cov-report xml"

0 comments on commit 99e251c

Please sign in to comment.