Skip to content

Commit 50c257f

Browse files
turegjorupclaude
andcommitted
6654: Add code coverage reporting to PHPUnit workflow
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 57ca65e commit 50c257f

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/pr.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,18 @@ jobs:
3131
- name: Create docker network
3232
run: docker network create frontend
3333

34-
- name: Run tests
34+
- name: Run tests with coverage
3535
run: |
36-
docker compose up --detach
37-
docker compose exec phpfpm composer install --no-interaction
38-
docker compose exec phpfpm composer run tests
36+
docker compose run --rm -e XDEBUG_MODE=coverage phpfpm composer install --no-interaction
37+
docker compose run --rm -e XDEBUG_MODE=coverage phpfpm vendor/bin/phpunit --coverage-clover=coverage/unit.xml
38+
39+
- name: Upload coverage to Codecov
40+
uses: codecov/codecov-action@v5
41+
with:
42+
token: ${{ secrets.CODECOV_TOKEN }}
43+
files: ./coverage/unit.xml
44+
fail_ci_if_error: true
45+
flags: unittests
3946

4047
fixtures:
4148
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)