From ef39a65c1bc5fc2516ddf72bb091205378277738 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 27 Jul 2025 20:39:26 +0300 Subject: [PATCH 1/3] fix(ci): Specify coverage report directory for Codecov This commit updates the CI workflow to explicitly set the `directory` for the Codecov action. This ensures the action correctly locates the `coverage.xml` file within the `promo_code` directory, resolving potential pathing issues during the upload process. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49e5152..2eeb873 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,4 +75,5 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} + directory: promo_code fail_ci_if_error: true From c825520f3ac9e3645c29897374257d4c650bb999 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 27 Jul 2025 21:02:35 +0300 Subject: [PATCH 2/3] refactor(ci): Simplify and correct coverage command This commit refactors the test and coverage generation step in the CI workflow. - The `cd` command is removed, and paths are handled directly in the `coverage` command for better clarity. - The `--source` option is added to ensure coverage is measured for the intended `business`, `core`, and `user` apps. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2eeb873..c1279f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: - name: Run tests and generate coverage report 🛡️ run: > docker compose exec -T web sh -c - "cd promo_code && coverage run --rcfile=.coveragerc manage.py test && coverage xml" + "coverage run --source='.' promo_code/manage.py test business core user && coverage xml -o promo_code/coverage.xml" - name: Copy coverage report from container 📂 run: docker compose cp web:/usr/src/app/promo_code/coverage.xml ./coverage.xml From 4b62a940f436abd6ac2d030a37d78d8c2191e02b Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 27 Jul 2025 21:12:37 +0300 Subject: [PATCH 3/3] fix(ci): Specify correct path for coverage config file --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1279f6..0bff02b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: - name: Run tests and generate coverage report 🛡️ run: > docker compose exec -T web sh -c - "coverage run --source='.' promo_code/manage.py test business core user && coverage xml -o promo_code/coverage.xml" + "coverage run --rcfile=promo_code/.coveragerc --source='.' promo_code/manage.py test business core user && coverage xml -o promo_code/coverage.xml" - name: Copy coverage report from container 📂 run: docker compose cp web:/usr/src/app/promo_code/coverage.xml ./coverage.xml