From 173423e7c98e571c901d411b28fe1481bc9f9834 Mon Sep 17 00:00:00 2001 From: dante di domenico Date: Thu, 3 Jul 2025 09:34:52 +0200 Subject: [PATCH] feat: codecov junit report --- .github/workflows/php-cs-stan-unit.yml | 10 ++++++++-- .github/workflows/php-unit.yml | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php-cs-stan-unit.yml b/.github/workflows/php-cs-stan-unit.yml index 7968ba6..e36ec33 100644 --- a/.github/workflows/php-cs-stan-unit.yml +++ b/.github/workflows/php-cs-stan-unit.yml @@ -153,8 +153,14 @@ jobs: - name: 'Dump Composer autoloader' run: 'composer dump-autoload --classmap-authoritative --no-cache' - - name: 'Run PHPUnit with coverage' - run: 'vendor/bin/phpunit --coverage-clover=${{ matrix.php-version }}-${{ strategy.job-index }}-clover.xml' + - name: 'Run PHPUnit with coverage and JUnit report' + run: 'vendor/bin/phpunit --coverage-clover=${{ matrix.php-version }}-${{ strategy.job-index }}-clover.xml --log-junit ${{ matrix.php-version }}-${{ strategy.job-index }}-junit.xml' + + - name: Upload test results to Codecov + uses: codecov/test-results-action@v1 + with: + files: './${{ matrix.php-version }}-${{ strategy.job-index }}-junit.xml' + token: ${{ secrets.CODECOV_TOKEN }} - name: Check test coverage id: test-coverage diff --git a/.github/workflows/php-unit.yml b/.github/workflows/php-unit.yml index c63455a..2333543 100644 --- a/.github/workflows/php-unit.yml +++ b/.github/workflows/php-unit.yml @@ -91,8 +91,14 @@ jobs: - name: 'Dump Composer autoloader' run: 'composer dump-autoload --classmap-authoritative --no-cache' - - name: 'Run PHPUnit with coverage' - run: 'vendor/bin/phpunit --coverage-clover=${{ matrix.php-version }}-${{ strategy.job-index }}-clover.xml' + - name: 'Run PHPUnit with coverage and JUnit report' + run: 'vendor/bin/phpunit --coverage-clover=${{ matrix.php-version }}-${{ strategy.job-index }}-clover.xml --log-junit ${{ matrix.php-version }}-${{ strategy.job-index }}-junit.xml' + + - name: Upload test results to Codecov + uses: codecov/test-results-action@v1 + with: + files: './${{ matrix.php-version }}-${{ strategy.job-index }}-junit.xml' + token: ${{ secrets.CODECOV_TOKEN }} - name: Check test coverage id: test-coverage