Skip to content
Closed
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
44 changes: 44 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
pytest_args: -m "not integration" -v --cov --cov-append --cov-report=xml
- os: windows-latest
pytest_args: -m "not integration" -v --cov --cov-append --cov-report=xml
env:
COVERAGE_FILE: .coverage.${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -52,6 +54,48 @@ jobs:
run: uv sync --locked --all-extras --dev
- name: Run tests
run: uv run tox -- ${{ matrix.pytest_args }}
- name: debug coverage output
shell: bash
run: |
echo "pwd=$(pwd)"
echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE"
echo "COVERAGE_FILE=$COVERAGE_FILE"
echo "ls in pwd:"
ls -la
echo "ls in workspace:"
ls -la "$GITHUB_WORKSPACE"
echo "find coverage under workspace:"
find "$GITHUB_WORKSPACE" -maxdepth 5 -name ".coverage*" -print
echo "find coverage under pwd:"
find "$(pwd)" -maxdepth 5 -name ".coverage*" -print
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}
path: ${{ github.workspace }}/${{ env.COVERAGE_FILE }}
if-no-files-found: error
include-hidden-files: true
coverage:
name: Upload Coverage
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Download coverage artifacts
uses: actions/download-artifact@v4
with:
path: coverage_artifacts
- name: Combine coverage
run: |
uv run coverage combine --ignore-errors coverage_artifacts/**/.coverage.*
uv run coverage xml -o coverage.xml
uv run coverage report -m
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
Expand Down
47 changes: 47 additions & 0 deletions diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index dedc189..b6fee54 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -42,6 +42,8 @@ jobs:
pytest_args: -m "not integration" -v --cov --cov-append --cov-report=xml
- os: windows-latest
pytest_args: -m "not integration" -v --cov --cov-append --cov-report=xml
+ env:
+ COVERAGE_FILE: .coverage.${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
@@ -52,6 +54,33 @@ jobs:
run: uv sync --locked --all-extras --dev
- name: Run tests
run: uv run tox -- ${{ matrix.pytest_args }}
+ - name: Upload coverage artifact
+ uses: actions/upload-artifact@v4
+ with:
+ name: coverage-${{ matrix.os }}
+ path: ${{ env.COVERAGE_FILE }}
+ if-no-files-found: error
+ coverage:
+ name: Combine & Upload Coverage
+ runs-on: ubuntu-latest
+ needs: tests
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: Install uv
+ uses: astral-sh/setup-uv@v6
+ - name: Install the project
+ run: uv sync --locked --all-extras --dev
+ - name: Download coverage artifacts
+ uses: actions/download-artifact@v4
+ with:
+ path: coverage_artifacts
+ - name: Combine coverage
+ run: |
+ uv run coverage combine coverage_artifacts/**/.coverage.*
+ uv run coverage xml -o coverage.xml
+ uv run coverage report -m
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ env_list =
runner = uv-venv-lock-runner
description = run the tests with pytest
pass_env =
COVERAGE_FILE
DOCKER_HOST
RYUK_CONTAINER_IMAGE
RYUK_RECONNECTION_TIMEOUT
Expand Down
Loading