From dda05c1703b66bf9b00719ded6463e93b1a4a84e Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Wed, 30 Jul 2025 11:23:32 +0200 Subject: [PATCH 1/2] Gettings missing test coverage always --- .github/workflows/_tests.yml | 10 ++++++++++ pyproject.toml | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_tests.yml b/.github/workflows/_tests.yml index e759f3a..c74c397 100644 --- a/.github/workflows/_tests.yml +++ b/.github/workflows/_tests.yml @@ -166,6 +166,8 @@ jobs: - name: Install packages run: uv pip install --system -e '.[test]' - name: Run tests + id: pytest + continue-on-error: true run: pytest --cov . - name: Upload coverage artifact uses: actions/upload-artifact@v4 @@ -175,6 +177,14 @@ jobs: name: ${{ env.ARTIFACT_NAME }} path: .coverage retention-days: 1 + - name: Validate run + run: | + if [ "${STEPS_PYTEST_OUTCOME}" != "success" ]; then + echo "Tests failed!" + exit 1 + fi + env: + STEPS_PYTEST_OUTCOME: ${{ steps.pytest.outcome }} coverage: runs-on: ubuntu-latest diff --git a/pyproject.toml b/pyproject.toml index fd017c2..9578d69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -152,7 +152,6 @@ omit = ["*/migrations_*/*"] [tool.coverage.report] show_missing = true -fail_under = 90 [tool.coverage.html] show_contexts = true From 94def18aa88531100d85fce44dbb142308d875e6 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Wed, 30 Jul 2025 11:47:56 +0200 Subject: [PATCH 2/2] Always the diff --- .github/workflows/_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_tests.yml b/.github/workflows/_tests.yml index c74c397..438743f 100644 --- a/.github/workflows/_tests.yml +++ b/.github/workflows/_tests.yml @@ -214,7 +214,6 @@ jobs: coverage combine $(find downloaded_artifacts/ -type f | xargs) # Used by codecov coverage xml - coverage report --format=markdown >> $GITHUB_STEP_SUMMARY - name: Upload single coverage artifact uses: actions/upload-artifact@v4 with: @@ -225,7 +224,6 @@ jobs: retention-days: 1 - name: Diff coverage run: | - coverage xml diff-cover coverage.xml --compare-branch origin/master --format github-annotations:warning - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 @@ -234,3 +232,5 @@ jobs: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} env_vars: OS,RUST + - name: Check + run: coverage report --format=markdown --fail-under=90 >> $GITHUB_STEP_SUMMARY