Skip to content

Generate standard code coverage report data file in python:test task #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions .github/workflows/test-python-poetry-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ jobs:
permissions:
contents: read

env:
COVERAGE_DATA_FILENAME: coverage.xml

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -102,14 +99,6 @@ jobs:
- name: Display code coverage report
run: task python:coverage-report

# codecov/codecov-action only makes the conversion if the `coverage` package is installed in the global runner
# environment
- name: Convert code coverage report to format required by Codecov
run: |
poetry run \
coverage xml \
-o "${{ github.workspace }}/${{ env.COVERAGE_DATA_FILENAME }}"

# A token is used to avoid intermittent spurious job failures caused by rate limiting.
- name: Set up Codecov upload token
run: |
Expand All @@ -128,5 +117,5 @@ jobs:
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
file: ${{ env.COVERAGE_DATA_FILENAME }}
file: coverage.xml
token: ${{ env.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules/
__pycache__/
.coverage
/coverage.xml
3 changes: 3 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ tasks:
--source="{{.PYTHON_PROJECT_PATH}}" \
--module \
pytest "{{.PYTHON_PROJECT_PATH}}/tests"
- |
poetry run \
coverage xml

# Make a temporary file named according to the passed TEMPLATE variable and print the path passed to stdout
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml
Expand Down