From ef46dd3d606260d1c5e3576f80324f08493d4a85 Mon Sep 17 00:00:00 2001 From: Mariot Tsitoara Date: Wed, 25 Mar 2026 09:37:54 +0100 Subject: [PATCH 1/2] [tool] feat(ci): add codecov (#194) --- .github/workflows/coverage.yml | 36 ++++++++++++++++++++++++++++++++++ pyproject.toml | 3 ++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..28ac0ca --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,36 @@ +name: Coverage + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + test-and-print-coverage: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -e '.[dev]' coverage + + - name: Run tests with coverage + run: python -m coverage run -m unittest + + - name: Print coverage summary + run: python -m coverage report -m --fail-under=70 + + diff --git a/pyproject.toml b/pyproject.toml index 94ab2cf..45e30a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,8 @@ dev = [ "types-pytz (>=2025.2.0.20250326,<2025.3.0.0)", "pre-commit (>=4.2.0,<4.3.0)", "types-python-dateutil (>=2.9.0,<2.10.0)", - "wheel (>=0.45.1,<0.46.0)" + "wheel (>=0.45.1,<0.46.0)", + "coverage>=7.13.5" ] doc = [ "autoapi (>=2.0.1,<2.1.0)", From fabbbb5564d204a3e696656aaae88df91ae7e243 Mon Sep 17 00:00:00 2001 From: Hugo Dupras Date: Thu, 2 Apr 2026 10:35:20 +0200 Subject: [PATCH 2/2] [tool] feat(ci): add codecov (#194) --- .github/workflows/coverage.yml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 28ac0ca..e4fe6b2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -15,22 +15,31 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Setup uv + uses: astral-sh/setup-uv@v8.0.0 with: python-version: "3.12" - name: Install dependencies run: | - python -m pip install --upgrade pip - python -m pip install -e '.[dev]' coverage + uv venv && uv pip install -e '.[dev]' coverage - name: Run tests with coverage - run: python -m coverage run -m unittest + run: uv run coverage run -m unittest - name: Print coverage summary - run: python -m coverage report -m --fail-under=70 - - + run: uv run coverage report -m --fail-under=70 + + - name: Generate coverage XML + run: uv run coverage xml -o coverage.xml + + - name: Upload coverage to Codecov + if: ${{ !cancelled() && hashFiles('coverage.xml') != '' }} + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: connectors + fail_ci_if_error: false + verbose: true