From 297a5a0700810adcc520989ceb4c0b13e1c63286 Mon Sep 17 00:00:00 2001 From: Edmond <1571649+EdmondDantes@users.noreply.github.com> Date: Sun, 27 Oct 2024 15:45:29 +0200 Subject: [PATCH] + Upload coverage to Codecov --- .github/workflows/php.yml | 15 ++++++++++++++- composer.json | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index d35b533..8cdbb8c 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -21,6 +21,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.3' + coverage: xdebug - name: Check PHP version run: php -v @@ -44,4 +45,16 @@ jobs: run: composer run-script analysis - name: Run test suite - run: composer run-script test + run: | + mkdir -p coverage + composer run-script test + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage/clover.xml + flags: unittests + name: code-coverage-report + fail_ci_if_error: true + verbose: true diff --git a/composer.json b/composer.json index fffbff6..012235c 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "phpstan/phpstan": "^1.12" }, "scripts": { - "test": "vendor/bin/phpunit ./tests", + "test": "vendor/bin/phpunit --coverage-clover=coverage/clover.xml ./tests", "analysis": "phpstan" } }