Skip to content
This repository was archived by the owner on Nov 17, 2024. It is now read-only.

Commit 47c0728

Browse files
ci: add codecov (#71)
1 parent 609ebd5 commit 47c0728

File tree

8 files changed

+35
-3
lines changed

8 files changed

+35
-3
lines changed

.github/workflows/python-tests.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,17 @@ jobs:
2424
python -m pip install -r requirements-dev.txt
2525
2626
- name: Test with pytest
27+
id: test
28+
shell: bash
2729
run: |
28-
python -m pytest -v
30+
python -m pytest \
31+
-rxXs \
32+
--tb=native \
33+
--verbose \
34+
--cov=gsms \
35+
tests
36+
37+
- name: Upload coverage
38+
# any except cancelled or skipped
39+
if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure')
40+
uses: codecov/codecov-action@v3

README.rst

+4
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,7 @@ Stats
128128
.. image:: https://img.shields.io/github/stars/lizardbyte/gsms?logo=github&style=for-the-badge
129129
:alt: GitHub stars
130130
:target: https://github.com/LizardByte/GSMS
131+
132+
.. image:: https://img.shields.io/codecov/c/gh/LizardByte/GSMS?token=IC678AQFBI&style=for-the-badge&logo=codecov&label=codecov
133+
:alt: Codecov
134+
:target: https://codecov.io/gh/LizardByte/GSMS

codecov.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
codecov:
3+
branch: master
4+
5+
coverage:
6+
status:
7+
project:
8+
default:
9+
target: auto
10+
threshold: 10%
11+
12+
comment:
13+
layout: "diff, flags, files"
14+
behavior: default
15+
require_changes: false # if true: only post the comment if coverage changes

gsms/__init__.py

Whitespace-only changes.

gsms.py renamed to gsms/gsms.py

File renamed without changes.

requirements-dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
flake8==6.1.0
33
pyinstaller==6.0.0
44
pytest==7.4.2
5+
pytest-cov==4.1.0

scripts/build.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
def build():
1515
"""Sets arguments for pyinstaller, creates spec, and builds binaries."""
1616
pyinstaller_args = [
17-
'gsms.py',
17+
'gsms/gsms.py',
1818
'--onefile',
1919
'--noconfirm',
2020
'--paths=./',

tests/unit/test_gsms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pytest
88

99
# local imports
10-
import gsms
10+
from gsms import gsms
1111

1212

1313
def test_windows_guid_wrapper():

0 commit comments

Comments
 (0)