Skip to content

Commit 78dedb7

Browse files
Merge pull request #67 from RandomProgramm3r/develop
ci: Fix coverage reporting and update badges 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. - Update Codecov badge URL.
2 parents b03cb3c + 8803b7c commit 78dedb7

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.env.example

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ DJANGO_SECRET_KEY=your_django_secret_key
88
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1,0.0.0.0
99

1010
POSTGRES_DATABASE=your_postgres_database_name
11-
POSTGRES_HOST=db
1211
POSTGRES_PASSWORD=your_postgres_password
13-
POSTGRES_PORT=5432
1412
POSTGRES_USERNAME=your_postgres_username
13+
POSTGRES_HOST=db
14+
POSTGRES_PORT=5432
15+
1516

1617
REDIS_HOST=redis
1718
REDIS_PORT=6379

.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:/usr/src/app/promo_code/coverage.xml ./coverage.xml
7073

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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)
4+
[![codecov](https://codecov.io/github/RandomProgramm3r/Promo-Code-API/branch/main/graph/badge.svg?token=VNBK0FAU3Z)](https://codecov.io/github/RandomProgramm3r/Promo-Code-API)
45
[![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)
5-
[![codecov](https://codecov.io/github/RandomProgramm3r/Promo-Code-API/graph/badge.svg?token=VNBK0FAU3Z)](https://codecov.io/github/RandomProgramm3r/Promo-Code-API)
66

77
The application provides an HTTP API for companies and end-users, is integrated with an external anti-fraud service, and uses PostgreSQL and Redis for data storage and caching.
88

0 commit comments

Comments
 (0)