ci: publish code coverage reports

This commit is contained in:
sebthom
2025-05-15 22:13:38 +02:00
parent 83c0d6adf0
commit 23910ffbf5
4 changed files with 47 additions and 1 deletions

View File

@@ -261,6 +261,36 @@ jobs:
docker push ghcr.io/$image_name
- name: Upload unit-test coverage to Codecov
uses: codecov/codecov-action@v5 # https://github.com/codecov/codecov-action
if: ${{ github.ref_name == 'main' || github.event_name == 'pull_request' }}
with:
files: .temp/coverage-unit.xml
flags: unit-tests
env_vars: OS,PYTHON
name: gha-u-${{ matrix.PYTHON_VERSION }}-${{ matrix.os }}
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.PYTHON_VERSION }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}
- name: Upload integration-test coverage to Codecov
uses: codecov/codecov-action@v5 # https://github.com/codecov/codecov-action
if: ${{ github.ref_name == 'main' || github.event_name == 'pull_request' }}
with:
files: .temp/coverage-integration.xml
flags: integration-tests
env_vars: OS,PYTHON
name: gha-i-${{ matrix.PYTHON_VERSION }}-${{ matrix.os }}
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.PYTHON_VERSION }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}
###########################################################
publish-release:
###########################################################

View File

@@ -3,7 +3,8 @@
[![Build Status](https://github.com/Second-Hand-Friends/kleinanzeigen-bot/actions/workflows/build.yml/badge.svg)](https://github.com/Second-Hand-Friends/kleinanzeigen-bot/actions/workflows/build.yml)
[![License](https://img.shields.io/github/license/Second-Hand-Friends/kleinanzeigen-bot.svg?color=blue)](LICENSE.txt)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.1%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
[![Maintainability](https://api.codeclimate.com/v1/badges/77b4ed9cc0dd8cfe373c/maintainability)](https://codeclimate.com/github/Second-Hand-Friends/kleinanzeigen-bot/maintainability)
[![codecov](https://codecov.io/github/Second-Hand-Friends/kleinanzeigen-bot/graph/badge.svg?token=SKLDTVWHVK)](https://codecov.io/github/Second-Hand-Friends/kleinanzeigen-bot)
<!--[![Maintainability](https://qlty.sh/badges/69ff94b8-90e1-4096-91ed-3bcecf0b0597/maintainability.svg)](https://qlty.sh/gh/Second-Hand-Friends/projects/kleinanzeigen-bot)-->
**Feedback and high-quality pull requests are highly welcome!**

12
codecov.yml Normal file
View File

@@ -0,0 +1,12 @@
# https://docs.codecov.com/docs/codecovyml-reference
# https://json.schemastore.org/codecov.json
codecov:
branch: main
require_ci_to_pass: true
notify:
wait_for_ci: true
coverage:
precision: 2
round: down
range: "65...100"

View File

@@ -336,7 +336,10 @@ filterwarnings = [
]
[tool.coverage.run]
# https://coverage.readthedocs.io/en/latest/config.html#run
data_file = ".temp/coverage.sqlite"
branch = true # track branch coverage
relative_files = true
#####################