Skip to content

Update how project uses Codecov #700

Description

@ryancheley

In a blog post by Hynek he says

So, I removed Codecov from all my projects and it’s glorious! Not only did I get rid of a flaky dependency, it also simplified my workflow. The interesting parts are the following: ...

He also posted this github worklow

coverage:
  name: Ensure 100% test coverage
  runs-on: ubuntu-latest
  needs: tests
  if: always()

  steps:
    - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
      with:
        persist-credentials: false
    - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
      with:
        # latest version you support, so it understands all syntax
        python-version: "3.14"
    - uses: hynek/setup-cached-uv@4300ec2180bc77d705e626a34e381b81a4772c51 # v2.5.0

    - name: Download coverage data
      uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
      with:
        pattern: coverage-data-*
        merge-multiple: true

    - name: Combine coverage and fail if it's <100%
      run: |
        uv tool install coverage

        coverage combine
        coverage html --skip-covered --skip-empty

        # Report and write to summary.
        coverage report --format=markdown >> $GITHUB_STEP_SUMMARY

        # Report again and fail if under 100%.
        coverage report --fail-under=100

    - name: Upload HTML report if check failed
      uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
      with:
        name: html-report
        path: htmlcov
      if: ${{ failure() }}

This issue serves as a way to migrate from Codecov to Hynek's suggested one.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions