Skip to content
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

Fix handling of cov files #190

Merged
merged 8 commits into from
Apr 13, 2023
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
1 change: 0 additions & 1 deletion .github/actions/report-coverage/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ inputs:
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
# Use latest Python, so it understands all syntax.
Expand Down
12 changes: 7 additions & 5 deletions .github/actions/upload-coverage/action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name: "Upload Coverage"
description: "Upload the coverage report(s) for this job"
inputs:
file_pattern:
description: "The coverage file pattern"
default: ".coverage"

runs:
using: "composite"
steps:
- name: Rename coverage file
shell: bash
run: |
if [ -f ".coverage" ]; then
mv .coverage ".coverage.-$$-$RANDOM"
fi
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: coverage-data
path: ${{inputs.file_pattern}}
path: ".coverage.*"
if-no-files-found: ignore
7 changes: 5 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,15 @@ jobs:

coverage_test:
name: Test coverage
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/base-setup
- run: |
pip install coverage pytest
pip install coverage[toml] pytest
python -m coverage run -m pytest foobar.py
ls -a
- uses: ./.github/actions/upload-coverage
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,7 @@ unfixable = [
# Don't touch noqa lines
"RUF100",
]

[tool.coverage.run]
relative_files = true
source = ["foobar"]