Skip to content

Commit

Permalink
gh-46: add infrastructure for coveralls (coverage) (#213)
Browse files Browse the repository at this point in the history
Add code coverage in workflow using pytest-cov and coveralls.

Closes: #46
Ref: #180
  • Loading branch information
Saransh-cpp authored Sep 16, 2024
1 parent 4185eaf commit 12f3265
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install -c .github/test-constraints.txt '.[test]'
- run: pytest -v
- run: pip install -c .github/test-constraints.txt -e '.[test]'
- run: pytest --cov=glass -v
- uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

build:
name: Build
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ __pycache__
_build
build
dist
.env
.coverage*
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
**GLASS**: Generator for Large Scale Structure
==============================================

[![Test](https://github.com/glass-dev/glass/actions/workflows/test.yml/badge.svg)](https://github.com/glass-dev/glass/actions/workflows/test.yml)
[![Documentation](https://readthedocs.org/projects/glass/badge/?version=latest)](https://glass.readthedocs.io/latest/)
[![Coverage Status](https://coveralls.io/repos/github/glass-dev/glass/badge.svg?branch=main)](https://coveralls.io/github/glass-dev/glass?branch=main)
[![PyPI](https://img.shields.io/pypi/v/glass)](https://pypi.org/project/glass)
[![arXiv](https://img.shields.io/badge/arXiv-2302.01942-red)](https://arxiv.org/abs/2302.01942)
[![adsabs](https://img.shields.io/badge/ads-2023OJAp....6E..11T-blueviolet)](https://ui.adsabs.harvard.edu/abs/2023OJAp....6E..11T)
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ examples = [
test = [
"fitsio",
"pytest",
"pytest-cov",
"scipy",
]

Expand Down

0 comments on commit 12f3265

Please sign in to comment.