Skip to content

Commit a2de77c

Browse files
author
Marat Akhmetov
committed
replaced codecov with pytest-cov
1 parent 9fde949 commit a2de77c

File tree

3 files changed

+32
-16
lines changed

3 files changed

+32
-16
lines changed

.github/workflows/test.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ concurrency:
1414

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

1819
permissions:
19-
contents: read
20+
contents: write
21+
checks: write
22+
pull-requests: write
2023

2124
jobs:
2225
tests:
@@ -119,13 +122,32 @@ jobs:
119122
- name: Generate coverate reports
120123
run: ./combine_coverage.sh
121124

122-
- name: Check coverage
123-
uses: codecov/codecov-action@v5
125+
- name: Coverage comment
126+
id: coverage
127+
uses: MishaKav/pytest-coverage-comment@v1
124128
with:
125-
token: ${{ secrets.CODECOV_TOKEN }}
126-
file: ./reports/coverage.xml
127-
fail_ci_if_error: true
128-
plugin: noop
129+
pytest-xml-coverage-path: ./reports/coverage.xml
130+
default-branch: develop
131+
xml-skip-covered: true
132+
report-only-changed-files: true
133+
hide-comment: ${{ github.event_name != 'pull_request' }}
134+
135+
- name: Dynamic Badges
136+
uses: schneegans/[email protected]
137+
if: github.repository == 'MobileTeleSystems/evacuator' && github.event_name == 'push'
138+
with:
139+
auth: ${{ secrets.AUTOMERGE_TOKEN }}
140+
gistID: 03e73a82ecc4709934540ce8201cc3b4
141+
filename: evacuator_badge.json
142+
label: Coverage
143+
message: ${{ steps.coverage.outputs.coverage }}
144+
color: ${{ steps.coverage.outputs.color }}
145+
146+
- name: Fail if coverage too low
147+
if: ${{ steps.coverage.outputs.coverage < env.MIN_COVERAGE }}
148+
run: |
149+
echo "Coverage is below ${{ env.MIN_COVERAGE }}%!"
150+
exit 1
129151
130152
- name: All done
131153
run: echo 1

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ Evacuator
2727
.. |CI Status| image:: https://github.com/MobileTeleSystems/evacuator/workflows/Tests/badge.svg
2828
:alt: Github Actions - latest CI build status
2929
:target: https://github.com/MobileTeleSystems/evacuator/actions
30-
.. |Test Coverage| image:: https://codecov.io/gh/MobileTeleSystems/evacuator/branch/develop/graph/badge.svg?token=CM6AQWY65P
31-
:alt: Test coverage - percent
32-
:target: https://codecov.io/gh/MobileTeleSystems/evacuator
30+
.. |Test Coverage| image:: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/
31+
MTSOnGithub/03e73a82ecc4709934540ce8201cc3b4/raw/evacuator_badge.json
32+
:target: https://github.com/MobileTeleSystems/evacuator/actions
3333
.. |pre-commit.ci Status| image:: https://results.pre-commit.ci/badge/github/MobileTeleSystems/evacuator/develop.svg
3434
:alt: pre-commit.ci - status
3535
:target: https://results.pre-commit.ci/latest/github/MobileTeleSystems/evacuator/develop

codecov.yml

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

0 commit comments

Comments
 (0)