From abe9dd3c03f0c948b0d054fffa16a47186606a45 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 4 Jan 2021 19:46:34 +0000 Subject: [PATCH] Build/Test Tools: Change the frequency of code coverage reporting. Before the coverage reports were submitted to Codecov.io, HTML coverage reports were compressed into ZIP files and uploaded to the workflow run as an artifact. A weekly schedule was chosen to run this workflow because generating a coverage report is more time consuming, and the resulting reports are quite large (~150-200MB each). This changes the schedule for the code coverage workflow from weekly to daily and eliminates the ZIP artifacts that were previously generated. This will ensure the code coverage data found at https://codecov.io/gh/WordPress/wordpress-develop is relatively accurate on any given day of the week without needlessly consuming artifact storage. Props jorbin. See #50401, #52141. git-svn-id: https://develop.svn.wordpress.org/trunk@49931 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/test-coverage.yml | 46 ++++++----------------------- 1 file changed, 9 insertions(+), 37 deletions(-) diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index 957d08a685..0fb12971f0 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -1,9 +1,9 @@ name: Code Coverage Report on: - # Once weekly On Sundays at 00:00 UTC. + # Once daily at 00:00 UTC. schedule: - - cron: '0 0 * * 0' + - cron: '0 0 * * *' env: LOCAL_DIR: build @@ -34,12 +34,10 @@ jobs: # - Logs WordPress Docker container debug information. # - Logs debug information about what's installed within the WordPress Docker containers. # - Install WordPress within the Docker container. - # - Run the PHPUnit tests. - # - Creates a ZIP file of the code coverage report. - # - Uploads ZIP file as an artifact. + # - Run the PHPUnit tests as a single site. + # - Upload the single site code coverage report to Codecov.io. # - Run the PHPUnit tests as a multisite. - # - Creates a ZIP file of the code coverage report. - # - Uploads ZIP file as an artifact. + # - Upload the multisite code coverage report to Codecov.io. test-coverage-report: name: Generate a code coverage report runs-on: ubuntu-latest @@ -124,44 +122,18 @@ 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 }} --coverage-clover wp-code-coverage-single-clover-${{ github.sha }}.xml + run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --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 - with: - filename: wp-code-coverage-single-${{ github.sha }}.zip - path: wp-code-coverage-single-${{ github.sha }} - - - name: Upload single site coverage report - uses: actions/upload-artifact@v2 - with: - name: wp-code-coverage-single-${{ github.sha }} - path: wp-code-coverage-single-${{ github.sha }}.zip - if-no-files-found: error - - - name: Upload single site report to codecov + - 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 }} --coverage-clover wp-code-coverage-multisite-clover-${{ github.sha }}.xml + run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --coverage-clover wp-code-coverage-multisite-clover-${{ github.sha }}.xml - - name: Create ZIP artifact of multisite results - uses: thedoctor0/zip-release@0.4.1 - with: - filename: wp-code-coverage-multisite-${{ github.sha }}.zip - path: wp-code-coverage-multisite-${{ github.sha }} - - - name: Upload multisite coverage report - uses: actions/upload-artifact@v2 - with: - 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 + - name: Upload multisite report to Codecov uses: codecov/codecov-action@v1 with: file: wp-code-coverage-multisite-clover-${{ github.sha }}.xml