Skip to content

Commit 4166728

Browse files
Merge pull request #32 from softwareengineerprogrammer/coverage-badge
Coverage badge NREL#22
2 parents 47b2d97 + 59a022a commit 4166728

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-3
lines changed

.github/workflows/github-actions.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,37 @@ jobs:
122122
run: >
123123
tox -e ${{ matrix.tox_env }} -v
124124
125+
coveralls:
126+
name: Upload coverage to Coveralls
127+
if: github.ref == 'refs/heads/main' # Prevent from running on PRs, tags
128+
needs: test
129+
runs-on: ubuntu-latest
130+
steps:
131+
- uses: actions/checkout@v4
132+
with:
133+
fetch-depth: 0
134+
- uses: actions/setup-python@v5
135+
with:
136+
python-version: '3.11'
137+
architecture: 'x64'
138+
- name: install dependencies
139+
run: |
140+
python -mpip install --upgrade pip
141+
python -mpip install --progress-bar=off -r ci/requirements.txt
142+
virtualenv --version
143+
pip --version
144+
tox --version
145+
pip list --format=freeze
146+
- name: generate coverage report
147+
env:
148+
TOXPYTHON: '3.11'
149+
run: |
150+
tox -e py311
151+
152+
- name: Coveralls GitHub Action
153+
uses: coverallsapp/[email protected]
154+
155+
125156
deploy_docs:
126157
name: Deploy docs to GitHub Pages
127158
if: github.ref == 'refs/heads/main' # Prevent from running on PRs, tags

README.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Free software: `MIT license <LICENSE>`__
2020

2121
* - tests
2222
- | |github-actions|
23+
- | |coverage|
2324
* - package
2425
- | |commits-since|
2526
.. TODO add the following to package badge list once PyPy distribution enabled: |version| |wheel| |supported-versions| |supported-implementations|
@@ -55,7 +56,9 @@ Free software: `MIT license <LICENSE>`__
5556
:target: https://nrel.github.io/GEOPHIRES-X
5657
:alt: Documentation Status
5758

58-
.. TODO coverage badge https://github.com/NREL/GEOPHIRES-Xx/issues/22
59+
.. |coverage| image:: https://coveralls.io/repos/github/softwareengineerprogrammer/GEOPHIRES-X/badge.svg
60+
:target: https://coveralls.io/github/softwareengineerprogrammer/GEOPHIRES-X
61+
5962

6063
.. end-badges
6164

tox.ini

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ basepython =
2828
py310: {env:TOXPYTHON:python3.10}
2929
py311: {env:TOXPYTHON:python3.11}
3030
py312: {env:TOXPYTHON:python3.12}
31-
{bootstrap,clean,check,report,docs}: {env:TOXPYTHON:python3}
31+
{bootstrap,clean,check,report,docs,coveralls}: {env:TOXPYTHON:python3}
3232
setenv =
3333
PYTHONPATH={toxinidir}/tests
3434
PYTHONUNBUFFERED=yes
@@ -74,7 +74,10 @@ commands =
7474
coverage html
7575

7676
[testenv:clean]
77-
commands = coverage erase
77+
commands =
78+
python setup.py clean
79+
coverage erase
7880
skip_install = true
7981
deps =
82+
setuptools
8083
coverage

0 commit comments

Comments
 (0)