Skip to content

Commit 8484d3e

Browse files
marashkaMarat Akhmetov
andauthored
replaced codecov with pytest-cov (#301)
Co-authored-by: Marat Akhmetov <ahmetovmr@mts.ru>
1 parent 2b72439 commit 8484d3e

3 files changed

Lines changed: 34 additions & 14 deletions

File tree

.github/workflows/test.yml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ concurrency:
1414

1515
env:
1616
DEFAULT_PYTHON: '3.13'
17+
MIN_COVERAGE: 93
1718

1819
jobs:
1920
tests:
@@ -110,6 +111,11 @@ jobs:
110111
name: Tests done
111112
runs-on: ubuntu-latest
112113

114+
permissions:
115+
contents: write
116+
checks: write
117+
pull-requests: write
118+
113119
if: always()
114120
needs: [tests]
115121

@@ -139,13 +145,32 @@ jobs:
139145
coverage combine coverage-data
140146
coverage xml -o combined_coverage.xml
141147
142-
- name: Check Coverage
143-
uses: codecov/codecov-action@v5
148+
- name: Coverage comment
149+
id: coverage
150+
uses: MishaKav/pytest-coverage-comment@v1
144151
with:
145-
token: ${{ secrets.CODECOV_TOKEN }}
146-
files: ./combined_coverage.xml
147-
fail_ci_if_error: true
148-
plugins: noop
152+
pytest-xml-coverage-path: ./combined_coverage.xml
153+
default-branch: develop
154+
xml-skip-covered: true
155+
report-only-changed-files: true
156+
hide-comment: ${{ github.event_name != 'pull_request' }}
157+
158+
- name: Dynamic Badges
159+
uses: schneegans/dynamic-badges-action@v1.7.0
160+
if: github.repository == 'MobileTeleSystems/data-rentgen' && github.event_name == 'push'
161+
with:
162+
auth: ${{ secrets.AUTOMERGE_TOKEN }}
163+
gistID: 03e73a82ecc4709934540ce8201cc3b4
164+
filename: data-rentgen_badge.json
165+
label: Coverage
166+
message: ${{ steps.coverage.outputs.coverage }}
167+
color: ${{ steps.coverage.outputs.color }}
168+
169+
- name: Fail if coverage too low
170+
if: ${{ steps.coverage.outputs.coverage < env.MIN_COVERAGE }}
171+
run: |
172+
echo "Coverage is below ${{ env.MIN_COVERAGE }}%!"
173+
exit 1
149174
150175
- name: All done
151176
run: echo 1

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
:target: https://data-rentgen.readthedocs.io/
2424
.. |Build Status| image:: https://github.com/MobileTeleSystems/data-rentgen/workflows/Tests/badge.svg
2525
:target: https://github.com/MobileTeleSystems/data-rentgen/actions
26-
.. |Coverage| image:: https://codecov.io/github/MobileTeleSystems/data-rentgen/graph/badge.svg?token=s0JztGZbq3
27-
:target: https://codecov.io/github/MobileTeleSystems/data-rentgen
26+
.. |Coverage| image:: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/
27+
MTSOnGithub/03e73a82ecc4709934540ce8201cc3b4/raw/data-rentgen_badge.json
28+
:target: https://github.com/MobileTeleSystems/data-rentgen/actions
2829
.. |pre-commit.ci| image:: https://results.pre-commit.ci/badge/github/MobileTeleSystems/data-rentgen/develop.svg
2930
:target: https://results.pre-commit.ci/latest/github/MobileTeleSystems/data-rentgen/develop
3031

codecov.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)