diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dedc189..4419c1e 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,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: diff --git a/diff b/diff new file mode 100644 index 0000000..a10a4db --- /dev/null +++ b/diff @@ -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: diff --git a/tox.ini b/tox.ini index 7fb0861..f3270e3 100644 --- a/tox.ini +++ b/tox.ini @@ -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