Skip to content

Commit 8225699

Browse files
authored
feat: add codecov CI and badge (#48)
* feat: add codecov CI and badge * feat: update codecov badge * feat: update codecov CI * feat: add pragma: no cover
1 parent 25ac3dc commit 8225699

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,16 @@ jobs:
4545
commit-check -h
4646
commit-check --message --branch --author-email
4747
48-
# - name: Collect Coverage
49-
# run: coverage run -m pytest
50-
51-
# - run: coverage report && coverage xml
52-
# - uses: codecov/codecov-action@v3
53-
# with:
54-
# files: ./coverage.xml
55-
# fail_ci_if_error: true # optional (default = false)
56-
# verbose: true # optional (default = false)
48+
- name: Collect Coverage
49+
run: |
50+
coverage run -m pytest
51+
coverage report && coverage xml
52+
- uses: codecov/codecov-action@v3
53+
with:
54+
token: ${{ secrets.CODECOV_TOKEN }}
55+
files: ./coverage.xml
56+
fail_ci_if_error: true # optional (default = false)
57+
verbose: true # optional (default = false)
5758

5859
install:
5960
needs: [build]

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dist
88
build
99
tests/__pycache__
1010
.coverage
11+
coverage.xml
1112

1213
# docs
1314
docs/_build

README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ Commit Check
1717
:alt: pre-commit.ci status
1818
:target: https://results.pre-commit.ci/latest/github/commit-check/commit-check/main
1919

20+
.. image:: https://codecov.io/gh/commit-check/commit-check/branch/main/graph/badge.svg?token=GC2U5V5ZRT
21+
:alt: CodeCov
22+
:target: https://codecov.io/gh/commit-check/commit-check
23+
2024
Overview
2125
--------
2226

commit_check/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,4 @@ def main() -> int:
109109

110110

111111
if __name__ == '__main__':
112-
raise SystemExit(main())
112+
raise SystemExit(main()) # pragma: no cover

0 commit comments

Comments
 (0)