Make WordPress Core


Ignore:
Timestamp:
02/12/2021 02:53:59 PM (4 years ago)
Author:
desrosj
Message:

Build/Test Tools: Merge several automated testing improvements to the 5.6 branch.

This merges several refinements to GitHub Action workflow files to the 5.6 branch.

It also includes [49836], which added the ability to replace mysql with mariadb when using the local Docker environment to ensure consistency of the tools across branches.

Props johnbillion.
Merges [49781-49784,49786,49836,49938,50268,50285] to the 5.6 branch.
See #50401.

Location:
branches/5.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.6

  • branches/5.6/.github/workflows/phpunit-tests.yml

    r49371 r50296  
    2525  # - Cancels all previous workflow runs for pull requests that have not completed.
    2626  # - Checks out the repository.
    27   # - Checks out the WordPress Importer plugin (needed for the Core PHPUnit tests).
    2827  # - Logs debug information about the runner container.
    29   # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches).
     28  # - Installs NodeJS 14.
    3029  # - Sets up caching for NPM.
    3130  # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
     
    3635    name: Setup WordPress
    3736    runs-on: ubuntu-latest
     37    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    3838
    3939    steps:
     
    4646      - name: Checkout repository
    4747        uses: actions/checkout@v2
    48 
    49       - name: Checkout the WordPress Importer plugin
    50         run: svn checkout -r 2387243 https://plugins.svn.wordpress.org/wordpress-importer/trunk/ tests/phpunit/data/plugins/wordpress-importer
    5148
    5249      - name: Log debug information
     
    6663        uses: actions/setup-node@v1
    6764        with:
    68           node-version: 12
     65          node-version: 14
    6966
    7067      - name: Cache NodeJS modules
     
    105102  # - Downloads the built WordPress artifact from the previous job.
    106103  # - Unzips the artifact.
    107   # - Installs NodeJS 12 (todo: install the version of NPM specified in the `nvmrc` file to support older branches)
     104  # - Installs NodeJS 14.
    108105  # - Sets up caching for NPM.
    109106  # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
     
    119116  # - Install WordPress within the Docker container.
    120117  # - Run the PHPUnit tests.
    121   # - Reports test results to the Distributed Hosting Tests.
     118  # - Checks out the WordPress Test reporter repository.
     119  # - Reconnect the directory to the Git repository.
     120  # - Submit the test results to the WordPress.org host test results.
    122121  # - todo: Configure Slack notifications for failing tests.
    123122  test-php:
     
    161160        uses: actions/setup-node@v1
    162161        with:
    163           node-version: 12
     162          node-version: 14
    164163
    165164      - name: Use cached Node modules
     
    189188        with:
    190189          path: ${{ steps.composer-cache.outputs.dir }}
    191           key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
     190          key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
    192191          restore-keys: |
    193             ${{ runner.os }}-composer-
     192            ${{ runner.os }}-php-${{ matrix.php }}-composer-
    194193
    195194      - name: Install Composer dependencies
     
    271270        run: LOCAL_PHP_XDEBUG=true npm run test:php -- -v --group xdebug --exclude-group __fakegroup__
    272271
    273       - name: WordPress Test Reporter
    274         if: ${{ matrix.report }}
     272      - name: Checkout the WordPress Test Reporter
     273        if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/master' && matrix.report }}
    275274        uses: actions/checkout@v2
    276275        with:
    277276          repository: 'WordPress/phpunit-test-runner'
    278277          path: 'test-runner'
    279         # TODO: Configure hidden keys to successfully report test results.
    280         # 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
     278
     279      - name: Set up the Git repository
     280        if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/master' && matrix.report }}
     281        run: |
     282          git init
     283          git remote add origin https://github.com/WordPress/wordpress-develop.git
     284          git fetch
     285          git reset origin/master
     286
     287      - name: Submit test results to the WordPress.org host test results
     288        if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/master' && matrix.report }}
     289        env:
     290          WPT_REPORT_API_KEY: "${{ secrets.WPT_REPORT_API_KEY }}"
     291        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
Note: See TracChangeset for help on using the changeset viewer.