From 505218bdbc94a24fc9a4db3db18033f6e3ee1dc8 Mon Sep 17 00:00:00 2001 From: nir0s Date: Mon, 29 Jun 2026 12:12:21 +0300 Subject: [PATCH 1/2] Remove Codecov integration Drop the Codecov coverage upload steps from CI and the coverage badge from the README. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/ci.yaml | 7 ------- README.md | 1 - 2 files changed, 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 113f772..59db011 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -61,11 +61,6 @@ jobs: - name: Run tox run: tox -e py - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - files: .coverage - windows: name: Windows runs-on: windows-latest @@ -73,8 +68,6 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: codecov/codecov-action@v3 - - name: Set up Python uses: actions/setup-python@v6 with: diff --git a/README.md b/README.md index 83ee3db..fe6298f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ Distro - an OS platform information API [![CI Status](https://github.com/python-distro/distro/workflows/CI/badge.svg)](https://github.com/python-distro/distro/actions/workflows/ci.yaml) [![PyPI version](http://img.shields.io/pypi/v/distro.svg)](https://pypi.python.org/pypi/distro) [![Supported Python Versions](https://img.shields.io/pypi/pyversions/distro.svg)](https://img.shields.io/pypi/pyversions/distro.svg) -[![Code Coverage](https://codecov.io/github/python-distro/distro/coverage.svg?branch=master)](https://codecov.io/github/python-distro/distro?branch=master) [![Is Wheel](https://img.shields.io/pypi/wheel/distro.svg?style=flat)](https://pypi.python.org/pypi/distro) [![Latest Github Release](https://readthedocs.org/projects/distro/badge/?version=stable)](http://distro.readthedocs.io/en/latest/) From 85c42fa787a33e8880d41b95383feb9c5198dcd8 Mon Sep 17 00:00:00 2001 From: nir0s Date: Mon, 29 Jun 2026 21:16:15 +0300 Subject: [PATCH 2/2] Generate coverage badge in CI without Codecov Add a Coverage workflow that runs on pushes to master, generates a coverage report via tox, builds an SVG badge with genbadge, and force-pushes it to an orphan coverage-badge branch. README links the raw badge file. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/coverage.yaml | 43 +++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/coverage.yaml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 0000000..3ec497a --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,43 @@ +name: Coverage + +on: + push: + branches: + - master + +permissions: + contents: write + +jobs: + coverage: + name: Generate coverage badge + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v5 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: Install tox and genbadge + run: python -m pip install tox "genbadge[coverage]" + + - name: Run tests with coverage + run: tox -e py -- --cov-report xml + + - name: Generate coverage badge + run: genbadge coverage -i coverage.xml -o coverage.svg + + - name: Publish badge to coverage-badge branch + run: | + cp coverage.svg "${RUNNER_TEMP}/coverage.svg" + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git checkout --orphan coverage-badge + git rm -rf . > /dev/null 2>&1 || true + cp "${RUNNER_TEMP}/coverage.svg" coverage.svg + git add coverage.svg + git commit -m "Update coverage badge" + git push --force origin coverage-badge diff --git a/README.md b/README.md index fe6298f..0f34892 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ Distro - an OS platform information API [![CI Status](https://github.com/python-distro/distro/workflows/CI/badge.svg)](https://github.com/python-distro/distro/actions/workflows/ci.yaml) [![PyPI version](http://img.shields.io/pypi/v/distro.svg)](https://pypi.python.org/pypi/distro) [![Supported Python Versions](https://img.shields.io/pypi/pyversions/distro.svg)](https://img.shields.io/pypi/pyversions/distro.svg) +[![Code Coverage](https://raw.githubusercontent.com/python-distro/distro/coverage-badge/coverage.svg)](https://github.com/python-distro/distro/actions/workflows/coverage.yaml) [![Is Wheel](https://img.shields.io/pypi/wheel/distro.svg?style=flat)](https://pypi.python.org/pypi/distro) [![Latest Github Release](https://readthedocs.org/projects/distro/badge/?version=stable)](http://distro.readthedocs.io/en/latest/)