Skip to content

Commit 6a5d4bc

Browse files
ci: Fix coverage reporting and update CI badge
This commit resolves issues with the CI workflow related to code coverage reporting. - Explicitly specifies the coverage configuration file (`--rcfile=.coveragerc`) to ensure correct settings are applied during tests. - Adds a step to copy the `coverage.xml` report from the Docker container to the host, making it available for the Codecov action. - Updates the CI status badge in the README to point to the correct workflow file.
1 parent 5935a46 commit 6a5d4bc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ jobs:
6666
- name: Run tests and generate coverage report 🛡️
6767
run: >
6868
docker compose exec -T web sh -c
69-
"cd promo_code && coverage run manage.py test && coverage xml"
69+
"cd promo_code && coverage run --rcfile=.coveragerc manage.py test && coverage xml"
70+
71+
- name: Copy coverage report from container 📂
72+
run: docker compose cp web:/app/promo_code/coverage.xml ./coverage.xml
7073

7174
- name: Upload coverage to Codecov 🚀
7275
uses: codecov/codecov-action@v5

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Promo Code API
22

3-
[![CI/CD](https://github.com/RandomProgramm3r/Promo-Code-API/actions/workflows/linting.yml/badge.svg)](https://github.com/RandomProgramm3r/Promo-Code-API/actions)
3+
[![CI/CD](https://github.com/RandomProgramm3r/Promo-Code-API/actions/workflows/ci.yml/badge.svg)](https://github.com/RandomProgramm3r/Promo-Code-API/actions)
44
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
55
[![codecov](https://codecov.io/github/RandomProgramm3r/Promo-Code-API/graph/badge.svg?token=VNBK0FAU3Z)](https://codecov.io/github/RandomProgramm3r/Promo-Code-API)
66

0 commit comments

Comments
 (0)