-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from BenediktBurger/add-codecov
Add codecov to CI
- Loading branch information
Showing
2 changed files
with
14 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,12 +68,8 @@ jobs: | |
run: mypy . | ||
|
||
test_coverage: | ||
name: Code Coverage | ||
name: Code Coverage on codecov | ||
runs-on: "ubuntu-latest" | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
issues: write | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
@@ -93,53 +89,18 @@ jobs: | |
# If the pytest problem matcher stops working because of bad paths, do an editable install | ||
run: pip install -e .[dev] # editable for covtest | ||
- name: Test for Coverage | ||
run: pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=pyleco | tee pytest-coverage.txt | ||
- name: Pytest Coverage Comment | ||
id: coverageComment | ||
uses: MishaKav/pytest-coverage-comment@main | ||
continue-on-error: true | ||
run: pytest --cov=pyleco --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
pytest-coverage-path: ./pytest-coverage.txt | ||
title: Coverage Report | ||
badge-title: PyLECO Coverage | ||
hide-badge: false | ||
hide-report: false | ||
create-new-comment: false | ||
hide-comment: false | ||
report-only-changed-files: false | ||
remove-link-from-badge: false | ||
unique-id-for-comment: python3 | ||
junitxml-path: ./pytest.xml | ||
junitxml-title: Coverage Summary | ||
- name: Check output coverage | ||
if: ${{ success() }} | ||
run: | | ||
echo "Coverage Percentage - ${{ steps.coverageComment.outputs.coverage }}" | ||
echo "Coverage Color - ${{ steps.coverageComment.outputs.color }}" | ||
echo "Coverage Html - ${{ steps.coverageComment.outputs.coverageHtml }}" | ||
echo "Coverage Warnings - ${{ steps.coverageComment.outputs.warnings }}" | ||
echo "Coverage Errors - ${{ steps.coverageComment.outputs.errors }}" | ||
echo "Coverage Failures - ${{ steps.coverageComment.outputs.failures }}" | ||
echo "Coverage Skipped - ${{ steps.coverageComment.outputs.skipped }}" | ||
echo "Coverage Tests - ${{ steps.coverageComment.outputs.tests }}" | ||
echo "Coverage Time - ${{ steps.coverageComment.outputs.time }}" | ||
echo "Not Success Test Info - ${{ steps.coverageComment.outputs.notSuccessTestInfo }}" | ||
- name: Create the Badge | ||
if: ${{ success() }} | ||
continue-on-error: true | ||
uses: schneegans/[email protected] | ||
with: | ||
auth: ${{ secrets.pyleco_coverage_gist_secret }} | ||
gistID: 7a8a7b874b62ed803eb56ca04830bede | ||
filename: pyleco-coverage.json | ||
label: Coverage Report | ||
message: ${{ steps.coverageComment.outputs.coverage }} | ||
color: ${{ steps.coverageComment.outputs.color }} | ||
namedLogo: python | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
directory: ./coverage/reports/ | ||
# env_vars: OS,PYTHON | ||
fail_ci_if_error: true | ||
files: ./coverage.xml,!./cache | ||
flags: unittests | ||
name: codecov-umbrella | ||
verbose: true | ||
|
||
test: | ||
name: Python ${{ matrix.python-version }}, ${{ matrix.os }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters