From a0a03bfb6ec387dc515f3b5e636c85a0047d9ce4 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Wed, 23 Dec 2020 18:17:51 +0000 Subject: [PATCH] Build/Test: Send Code Coverage reports to Codecov. Help visualize and explore code coverage reports to avoid blunders. Props desrosj, swissspidy. Fixes #52141. git-svn-id: https://develop.svn.wordpress.org/trunk@49903 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/test-coverage.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index d191fff3f3..957d08a685 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -124,7 +124,7 @@ jobs: run: npm run env:install - name: Run tests as a single site - run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --coverage-html wp-code-coverage-single-${{ github.sha }} + run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --coverage-html wp-code-coverage-single-${{ github.sha }} --coverage-clover wp-code-coverage-single-clover-${{ github.sha }}.xml - name: Create ZIP artifact of single site results uses: thedoctor0/zip-release@0.4.1 @@ -139,8 +139,14 @@ jobs: path: wp-code-coverage-single-${{ github.sha }}.zip if-no-files-found: error + - name: Upload single site report to codecov + uses: codecov/codecov-action@v1 + with: + file: wp-code-coverage-single-clover-${{ github.sha }}.xml + flags: single,php + - name: Run tests as a multisite install - run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --coverage-html wp-code-coverage-multisite-${{ github.sha }} + run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --coverage-html wp-code-coverage-multisite-${{ github.sha }} --coverage-clover wp-code-coverage-multisite-clover-${{ github.sha }}.xml - name: Create ZIP artifact of multisite results uses: thedoctor0/zip-release@0.4.1 @@ -154,3 +160,9 @@ jobs: name: wp-code-coverage-multisite-${{ github.sha }} path: wp-code-coverage-multisite-${{ github.sha }}.zip if-no-files-found: error + + - name: Upload multisite report to codecov + uses: codecov/codecov-action@v1 + with: + file: wp-code-coverage-multisite-clover-${{ github.sha }}.xml + flags: multisite,php