From 0f636b823bd30b3dc51109a0001e317824ea6bca Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 26 Mar 2021 15:09:19 +0000 Subject: [PATCH] Build/Test Tools: Run code coverage workflow using parallel jobs. This splits the code coverage workflow into two separate jobs, allowing single site and multisite to run in parallel. This cuts the total workflow run time in half. Fixes #52923. git-svn-id: https://develop.svn.wordpress.org/trunk@50594 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/test-coverage.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index 1e1720805d..2f86670b71 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -47,9 +47,13 @@ jobs: # - Run the PHPUnit tests as a multisite. # - Upload the multisite code coverage report to Codecov.io. test-coverage-report: - name: Generate a code coverage report + name: ${{ matrix.multisite && 'Multisite' || 'Single site' }} report runs-on: ubuntu-latest if: ${{ github.repository == 'WordPress/wordpress-develop' }} + strategy: + fail-fast: false + matrix: + multisite: [ false, true ] steps: - name: Configure environment variables @@ -122,18 +126,22 @@ jobs: run: npm run env:install - name: Run tests as a single site + if: ${{ ! matrix.multisite }} run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --coverage-clover wp-code-coverage-single-clover-${{ github.sha }}.xml - name: Upload single site report to Codecov + if: ${{ ! matrix.multisite }} uses: codecov/codecov-action@e156083f13aff6830c92fc5faa23505779fbf649 # v1.2.1 with: file: wp-code-coverage-single-clover-${{ github.sha }}.xml flags: single,php - name: Run tests as a multisite install + if: ${{ matrix.multisite }} run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --coverage-clover wp-code-coverage-multisite-clover-${{ github.sha }}.xml - name: Upload multisite report to Codecov + if: ${{ matrix.multisite }} uses: codecov/codecov-action@e156083f13aff6830c92fc5faa23505779fbf649 # v1.2.1 with: file: wp-code-coverage-multisite-clover-${{ github.sha }}.xml