From e86d912e3c98aec839dc963d479f11a662702bf1 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Thu, 10 Dec 2020 14:18:12 +0000 Subject: [PATCH] Build/Test Tools: Enable reporting of results to WordPress.org. This configures reporting of the test results to the WordPress.org Host Test Results in the new GitHub Actions workflow for PHPUnit testing. See https://make.wordpress.org/hosting/test-results/ Props mikeschroder, dd32. See #50401. git-svn-id: https://develop.svn.wordpress.org/trunk@49783 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/phpunit-tests.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index 848d48815a..80c05f88ad 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -272,10 +272,14 @@ jobs: run: LOCAL_PHP_XDEBUG=true npm run test:php -- -v --group xdebug --exclude-group __fakegroup__ - name: WordPress Test Reporter - if: ${{ matrix.report }} + if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/master' && matrix.report }} uses: actions/checkout@v2 with: repository: 'WordPress/phpunit-test-runner' path: 'test-runner' - # TODO: Configure hidden keys to successfully report test results. - # run: docker-compose run --rm -e WPT_REPORT_API_KEY -e WPT_PREPARE_DIR=/var/www -e WPT_TEST_DIR=/var/www php php test-runner/report.php + + - name: WordPress Test Reporter + if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/master' && matrix.report }} + env: + WPT_REPORT_API_KEY: ${{ secrets.WPT_REPORT_API_KEY }} + run: docker-compose run --rm -e "$WPT_REPORT_API_KEY" -e WPT_PREPARE_DIR=/var/www -e WPT_TEST_DIR=/var/www php php test-runner/report.php