From b92d3eab0156121c391a37d2a63438ec62fc536a Mon Sep 17 00:00:00 2001 From: "Axel H." Date: Mon, 29 Dec 2025 22:17:39 +0100 Subject: [PATCH] ci(coverage): restore builds on `master`, fix Codecov coverage report and adds test analytics (fix #1606) --- .github/workflows/pythonpackage.yml | 17 ++++++++++++----- .gitignore | 1 + pyproject.toml | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 7605301822..850cb57c0e 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -1,6 +1,11 @@ name: Python package -on: [workflow_dispatch, pull_request] +on: + push: + branches: + - master + pull_request: + workflow_dispatch: jobs: python-check: @@ -29,10 +34,12 @@ jobs: poetry ci shell: bash - name: Upload coverage to Codecov - if: runner.os == 'Linux' uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml - flags: unittests - name: codecov-umbrella + - name: Upload test results to Codecov + uses: codecov/codecov-action@v5 + if: ${{ !cancelled() }} + with: + token: ${{ secrets.CODECOV_TOKEN }} + report_type: test_results diff --git a/.gitignore b/.gitignore index be07cf2d93..fb467da46c 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ coverage.xml *.cover .hypothesis/ .pytest_cache +junit.xml # Translations *.mo diff --git a/pyproject.toml b/pyproject.toml index 7b5c5d35a9..76896d3500 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -265,7 +265,7 @@ test.cmd = "pytest -n 3 --dist=loadfile" "test:all".cmd = "tox --parallel" cover.help = "Run the test suite with coverage" -cover.ref = "test --cov-report term-missing --cov-report=xml:coverage.xml --cov=commitizen" +cover.ref = "test --cov-report term-missing --cov-report=xml:coverage.xml --cov=commitizen --junitxml=junit.xml -o junit_family=legacy" all.help = "Run all tasks" all.sequence = ["format", "lint", "check-commit", "cover"]