WordPress.org

Make WordPress Core

Changeset 50306


Ignore:
Timestamp:
02/12/2021 07:16:28 PM (8 months ago)
Author:
desrosj
Message:

Build/Test Tools: Restore automated testing in the 5.1 branch.

This commit merges the workflow files required to run automated testing on GitHub Actions.

In addition, [49836] and [50285] have been included in order to keep the local Docker environment consistent across all branches.

Merges [49162,49168-49169,49175,49204,49227-49228,49244,49369,49371,49548,49781-49784,49786,49836,49938,50268,50285,50298] to the 5.1 branch.
See #50401.

Location:
branches/5.1
Files:
1 added
11 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/5.1

  • branches/5.1/.env

    r49528 r50306  
    4646LOCAL_PHP_MEMCACHED=false
    4747
    48 # The MySQL version to use. See https://hub.docker.com/_/mysql/ for valid versions.
    49 LOCAL_MYSQL=5.7
     48##
     49# The database software to use.
     50#
     51# Supported values are `mysql` and `mariadb`.
     52##
     53LOCAL_DB_TYPE=mysql
     54
     55##
     56# The database version to use.
     57#
     58# Defaults to 5.7 with the assumption that LOCAL_DB_TYPE is set to `mysql` above.
     59#
     60# When using `mysql`, see https://hub.docker.com/_/mysql/ for valid versions.
     61# When using `mariadb`, see https://hub.docker.com/_/mariadb for valid versions.
     62##
     63LOCAL_DB_VERSION=5.7
    5064
    5165# The debug settings to add to `wp-config.php`.
     
    5872# The URL to use when running e2e tests.
    5973WP_BASE_URL=http://localhost:${LOCAL_PORT}
     74
     75##
     76# The revision number of the WordPress Importer plugin to use when running unit tests.
     77#
     78# This should be an SVN revision number from the official plugin repository on wordpress.org.
     79##
     80WP_IMPORTER_REVISION=2387243
  • branches/5.1/.github/workflows/coding-standards.yml

    r49162 r50306  
    55    branches:
    66      - master
     7      # JSHint was introduced in WordPress 3.8.
    78      # PHPCS checking was introduced in WordPress 5.1.
    8       - '5.[1-9]'
    9       - '[6-9].*'
     9      - '3.[89]'
     10      - '[4-9].[0-9]'
     11    tags:
     12      - '3.[89]*'
     13      - '[4-9].[0-9]*'
    1014  pull_request:
    1115
     
    1721  # Performs the following steps:
    1822  # - Checks out the repository.
    19   # - Configures caching for Composer.
    2023  # - Sets up PHP.
    2124  # - Logs debug information.
    22   # - Installs Composer dependencies (from cache if possible).
     25  # - Installs Composer dependencies (use cache if possible).
     26  # - Make Composer packages available globally.
    2327  # - Logs PHP_CodeSniffer debug information.
    2428  # - Runs PHPCS on the full codebase with warnings suppressed.
     
    2832    name: PHP coding standards
    2933    runs-on: ubuntu-latest
     34    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     35
    3036    steps:
    3137      - name: Checkout repository
    3238        uses: actions/checkout@v2
    3339
    34       - name: Get Composer cache directory
    35         id: composer-cache
    36         run: echo "::set-output name=dir::$(composer config cache-files-dir)"
    37 
    38       - name: Set up Composer caching
    39         uses: actions/cache@v2
    40         env:
    41           cache-name: cache-composer-dependencies
    42         with:
    43           path: ${{ steps.composer-cache.outputs.dir }}
    44           key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
    45           restore-keys: |
    46             ${{ runner.os }}-composer-
    47 
    4840      - name: Set up PHP
    4941        uses: shivammathur/setup-php@v2
    5042        with:
    51           php-version: '7.4'
     43          php-version: '7.2'
    5244          coverage: none
    5345          tools: composer, cs2pr
     
    5951
    6052      - name: Install Composer dependencies
    61         run: |
    62           composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction
    63           echo "vendor/bin" >> $GITHUB_PATH
     53        uses: ramsey/composer-install@v1
     54        with:
     55          composer-options: "--no-progress --no-ansi --no-interaction"
     56
     57      - name: Make Composer packages available globally
     58        run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
    6459
    6560      - name: Log PHPCS debug information
    6661        run: phpcs -i
    6762
    68       - name: Run PHPCS on all Core files
    69         run: vendor/bin/phpcs -q -n --report=checkstyle | cs2pr
    70 
    71       - name: Check test suite files for warnings
    72         run: vendor/bin/phpcs tests -q --report=checkstyle | cs2pr
     63      - name: Run PHPCBF on all Core files
     64        run: phpcbf
    7365
    7466  # Runs the JavaScript coding standards checks.
     67  #
     68  # JSHint violations are not currently reported inline with annotations.
    7569  #
    7670  # Performs the following steps:
    7771  # - Checks out the repository.
    7872  # - Logs debug information about the runner container.
    79   # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches)
     73  # - Installs NodeJS 14.
    8074  # - Sets up caching for NPM.
    8175  # - Logs updated debug information.
    82   # _ Installs NPM dependencies.
     76  # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
    8377  # - Run the WordPress JSHint checks.
    8478  # - todo: Configure Slack notifications for failing tests.
     
    8680    name: JavaScript coding standards
    8781    runs-on: ubuntu-latest
     82    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     83    env:
     84      PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
     85
    8886    steps:
    8987      - name: Checkout repository
     
    10098        uses: actions/setup-node@v1
    10199        with:
    102           node-version: 12
     100          node-version: 14
    103101
    104102      - name: Cache NodeJS modules
     
    119117
    120118      - name: Install Dependencies
    121         run: npm ci
     119        run: npx install-changed --install-command="npm ci"
    122120
    123121      - name: Run JSHint
  • branches/5.1/.github/workflows/end-to-end-tests.yml

    r49162 r50306  
    77      # The end to end test suite was introduced in WordPress 5.3.
    88      - '5.[3-9]'
    9       - '[6-9].*'
     9      - '[6-9].[0-9]'
     10    tags:
     11      - '5.[3-9]*'
     12      - '[6-9].[0-9]*'
    1013  pull_request:
    1114
     
    1720  #
    1821  # Performs the following steps:
    19   # - Cancels all previous workflow runs that have not completed.
     22  # - Cancels all previous workflow runs for pull requests that have not completed.
    2023  # - Set environment variables.
    2124  # - Checks out the repository.
    2225  # - Logs debug information about the runner container.
    23   # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches)
     26  # - Installs NodeJS 14.
    2427  # - Sets up caching for NPM.
    25   # _ Installs NPM dependencies.
     28  # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
    2629  # - Builds WordPress to run from the `build` directory.
    2730  # - Starts the WordPress Docker container.
    2831  # - Logs general debug information.
    2932  # - Logs the running Docker containers.
    30   # - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container)
     33  # - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container).
    3134  # - Install WordPress within the Docker container.
    3235  # - Run the E2E tests.
     
    3538    name: E2E Tests
    3639    runs-on: ubuntu-latest
     40    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     41
    3742    steps:
    38       - name: Cancel previous runs of this workflow
     43      - name: Cancel previous runs of this workflow (pull requests only)
     44        if: ${{ github.event_name == 'pull_request' }}
    3945        uses: styfle/cancel-workflow-action@0.5.0
    4046        with:
     
    6369        uses: actions/setup-node@v1
    6470        with:
    65           node-version: 12
     71          node-version: 14
    6672
    6773      - name: Cache NodeJS modules
     
    7783
    7884      - name: Install Dependencies
    79         run: npm ci
     85        run: npx install-changed --install-command="npm ci"
    8086
    8187      - name: Build WordPress
  • branches/5.1/.github/workflows/javascript-tests.yml

    r49162 r50306  
    55    branches:
    66      - master
    7       - '*.*'
     7      # JavaScript testing was introduced in WordPress 3.8.
     8      - '3.[89]'
     9      - '[4-9].[0-9]'
     10    tags:
     11      - '3.[89]*'
     12      - '[4-9].[0-9]*'
    813  pull_request:
    914
     
    1217  #
    1318  # Performs the following steps:
    14   # - Cancels all previous workflow runs that have not completed.
     19  # - Cancels all previous workflow runs for pull requests that have not completed.
    1520  # - Checks out the repository.
    1621  # - Logs debug information about the runner container.
    17   # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches)
     22  # - Installs NodeJS 14.
    1823  # - Sets up caching for NPM.
    1924  # - Logs updated debug information.
    20   # _ Installs NPM dependencies.
     25  # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
    2126  # - Run the WordPress QUnit tests.
    2227  # - todo: Configure Slack notifications for failing tests.
     
    2429    name: QUnit Tests
    2530    runs-on: ubuntu-latest
     31    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     32
    2633    steps:
    27       - name: Cancel previous runs of this workflow
     34      - name: Cancel previous runs of this workflow (pull requests only)
     35        if: ${{ github.event_name == 'pull_request' }}
    2836        uses: styfle/cancel-workflow-action@0.5.0
    2937        with:
     
    4351        uses: actions/setup-node@v1
    4452        with:
    45           node-version: 12
     53          node-version: 14
    4654
    4755      - name: Cache NodeJS modules
     
    6270
    6371      - name: Install Dependencies
    64         run: npm ci
     72        run: npx install-changed --install-command="npm ci"
    6573
    6674      - name: Run QUnit tests
  • branches/5.1/.github/workflows/php-compatibility.yml

    r49162 r50306  
    77      # The PHP compatibility testing was introduced in WordPress 5.5.
    88      - '5.[5-9]'
    9       - '[6-9].*'
     9      - '[6-9].[0-9]'
     10    tags:
     11      - '5.[5-9]*'
     12      - '[6-9].[0-9]*'
    1013  pull_request:
    1114
     
    1821  # Performs the following steps:
    1922  # - Checks out the repository.
    20   # - Configures caching for Composer.
    2123  # - Sets up PHP.
    2224  # - Logs debug information about the runner container.
    23   # - Installs Composer dependencies (from cache if possible).
     25  # - Installs Composer dependencies (use cache if possible).
     26  # - Make Composer packages available globally.
    2427  # - Logs PHP_CodeSniffer debug information.
    2528  # - Runs the PHP compatibility tests.
     
    2831    name: Check PHP compatibility
    2932    runs-on: ubuntu-latest
     33    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    3034
    3135    steps:
    3236      - name: Checkout repository
    3337        uses: actions/checkout@v2
    34 
    35       - name: Get Composer cache directory
    36         id: composer-cache
    37         run: echo "::set-output name=dir::$(composer config cache-files-dir)"
    38 
    39       - name: Set up Composer caching
    40         uses: actions/cache@v2
    41         env:
    42           cache-name: cache-composer-dependencies
    43         with:
    44           path: ${{ steps.composer-cache.outputs.dir }}
    45           key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
    46           restore-keys: |
    47             ${{ runner.os }}-composer-
    4838
    4939      - name: Set up PHP
     
    6050
    6151      - name: Install Composer dependencies
    62         run: |
    63           composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction
    64           echo "vendor/bin" >> $GITHUB_PATH
     52        uses: ramsey/composer-install@v1
     53        with:
     54          composer-options: "--no-progress --no-ansi --no-interaction"
     55
     56      - name: Make Composer packages available globally
     57        run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
     58
     59      - name: Log PHPCS debug information
     60        run: phpcs -i
    6561
    6662      - name: Run PHP compatibility tests
    67         run: vendor/bin/phpcs --standard=phpcompat.xml.dist -q --report=checkstyle | cs2pr
     63        run: phpcs --standard=phpcompat.xml.dist -q --report=checkstyle | cs2pr
  • branches/5.1/.github/workflows/phpunit-tests.yml

    r49162 r50306  
    55    branches:
    66      - master
    7       - '*.*'
     7      - '3.[7-9]'
     8      - '[4-9].[0-9]'
     9    tags:
     10      - '3.[7-9]*'
     11      - '[4-9].[0-9]*'
    812  pull_request:
    913  # Once weekly On Sundays at 00:00 UTC.
     
    2327  #
    2428  # Performs the following steps:
    25   # - Cancels all previous workflow runs that have not completed.
     29  # - Cancels all previous workflow runs for pull requests that have not completed.
    2630  # - Checks out the repository.
    27   # - Checks out the WordPress Importer plugin (needed for the Core PHPUnit tests).
    2831  # - 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)
     32  # - Installs NodeJS 14.
    3033  # - Sets up caching for NPM.
    31   # _ Installs NPM dependencies.
     34  # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
    3235  # - Builds WordPress to run from the `build` directory.
    33   # - Creates a ZIP file of compiled WordPress
     36  # - Creates a ZIP file of compiled WordPress.
    3437  # - Uploads ZIP file as an artifact.
    3538  setup-wordpress:
    3639    name: Setup WordPress
    3740    runs-on: ubuntu-latest
     41    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
    3842
    3943    steps:
    40       - name: Cancel previous runs of this workflow
     44      - name: Cancel previous runs of this workflow (pull requests only)
     45        if: ${{ github.event_name == 'pull_request' }}
    4146        uses: styfle/cancel-workflow-action@0.5.0
    4247        with:
     
    4651        uses: actions/checkout@v2
    4752
    48       - name: Checkout the WordPress Importer plugin
    49         run: svn checkout -r 2387243 https://plugins.svn.wordpress.org/wordpress-importer/trunk/ tests/phpunit/data/plugins/wordpress-importer
    50 
    5153      - name: Log debug information
    5254        run: |
     55          echo "$GITHUB_REF"
     56          echo "$GITHUB_EVENT_NAME"
    5357          npm --version
    5458          node --version
     
    6367        uses: actions/setup-node@v1
    6468        with:
    65           node-version: 12
     69          node-version: 14
    6670
    6771      - name: Cache NodeJS modules
     
    7781
    7882      - name: Install Dependencies
    79         run: npm ci
     83        run: npx install-changed --install-command="npm ci"
    8084
    8185      - name: Build WordPress
     
    8690        with:
    8791          filename: built-wp-${{ github.sha }}.zip
    88           exclusions: '/*node_modules/*'
     92          exclusions: '*.git* /*node_modules/* packagehash.txt'
    8993
    9094      - name: Upload build artifact
     
    102106  # - Downloads the built WordPress artifact from the previous job.
    103107  # - Unzips the artifact.
    104   # - Installs NodeJS 12 (todo: install the version of NPM specified in the `nvmrc` file to support older branches)
     108  # - Installs NodeJS 14.
    105109  # - Sets up caching for NPM.
    106   # _ Installs NPM dependencies.
     110  # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
    107111  # - Configures caching for Composer.
    108   # _ Installs Composer dependencies (if desired)
    109   # - Logs Docker debug information (about both the Docker installation within the runner)
     112  # _ Installs Composer dependencies (if desired).
     113  # - Logs Docker debug information (about both the Docker installation within the runner).
    110114  # - Starts the WordPress Docker container.
    111115  # - Starts the memcached server after the Docker network has been created (if desired).
     
    113117  # - Logs debug general information.
    114118  # - Logs the running Docker containers.
    115   # - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container)
     119  # - Logs debug information about what's installed within the WordPress Docker containers.
    116120  # - Install WordPress within the Docker container.
    117121  # - Run the PHPUnit tests.
    118   # - Reports test results to the Distributed Hosting Tests.
     122  # - Checks out the WordPress Test reporter repository.
     123  # - Reconnect the directory to the Git repository.
     124  # - Submit the test results to the WordPress.org host test results.
    119125  # - todo: Configure Slack notifications for failing tests.
    120126  test-php:
    121     name: ${{ matrix.php_versions }} on ${{ matrix.os }}
     127    name: ${{ matrix.php }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }}
    122128    needs: setup-wordpress
    123129    runs-on: ${{ matrix.os }}
    124130    strategy:
    125131      matrix:
    126         php_versions: [ '8.0', 7.4, '7.4 with memcached', 7.3, 7.2, 7.1, '7.0', 5.6.20 ]
     132        php: [ '7.3' ]
     133        phpunit: [ '7.3' ]
    127134        os: [ ubuntu-latest ]
     135        memcached: [ false ]
     136        include:
     137          # Include job for PHP 7.3 with memcached.
     138          - php: '7.3'
     139            phpunit: '7.3'
     140            os: ubuntu-latest
     141            memcached: false
     142          - php: '7.2'
     143            phpunit: '7.2'
     144            os: ubuntu-latest
     145            memcached: false
     146          - php: '7.1'
     147            phpunit: '7.1'
     148            os: ubuntu-latest
     149            memcached: false
     150          - php: '7.0'
     151            phpunit: '6-php-7.0'
     152            os: ubuntu-latest
     153            memcached: false
     154          - php: '5.6'
     155            phpunit: '4-php-5.6'
     156            os: ubuntu-latest
     157            memcached: false
     158          - php: '5.5'
     159            phpunit: '5.5'
     160            os: ubuntu-latest
     161            memcached: false
     162          - php: '5.4'
     163            phpunit: '5.4'
     164            os: ubuntu-latest
     165            memcached: false
     166          - php: '5.3'
     167            phpunit: '5.3'
     168            os: ubuntu-latest
     169            memcached: false
    128170    env:
    129       LOCAL_PHP: ${{ matrix.php_versions }}-fpm
     171      LOCAL_PHP: ${{ matrix.php }}-fpm
     172      LOCAL_PHPUNIT: ${{ matrix.phpunit }}-fpm
     173      LOCAL_PHP_MEMCACHED: ${{ matrix.memcached }}
    130174
    131175    steps:
     
    135179          echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
    136180
    137       - name: Configure memcached
    138         if: ${{ contains( matrix.php_versions, 'memcached' ) }}
    139         run: |
    140           echo "LOCAL_PHP=$(echo ${{ matrix.php_versions }} | cut -c1-3)-fpm" >> $GITHUB_ENV
    141           echo "LOCAL_PHP_MEMCACHED=true" >> $GITHUB_ENV
    142 
    143181      - name: Download the built WordPress artifact
    144182        uses: actions/download-artifact@v2
     
    152190        uses: actions/setup-node@v1
    153191        with:
    154           node-version: 12
     192          node-version: 14
    155193
    156194      - name: Use cached Node modules
     
    166204
    167205      - name: Install Dependencies
    168         run: npm ci
    169 
    170       - name: Get composer cache directory
    171         id: composer-cache
    172         if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }}
    173         run: echo "::set-output name=dir::$(composer config cache-files-dir)"
     206        run: npx install-changed --install-command="npm ci"
    174207
    175208      - name: Cache Composer dependencies
    176         if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }}
     209        if: ${{ env.COMPOSER_INSTALL == true }}
    177210        uses: actions/cache@v2
    178211        env:
     
    180213        with:
    181214          path: ${{ steps.composer-cache.outputs.dir }}
    182           key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
     215          key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
    183216          restore-keys: |
    184             ${{ runner.os }}-composer-
     217            ${{ runner.os }}-php-${{ matrix.php }}-composer-
    185218
    186219      - name: Install Composer dependencies
    187         if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }}
     220        if: ${{ env.COMPOSER_INSTALL == true }}
    188221        run: |
    189222          docker-compose run --rm php composer --version
    190 
    191           # The PHPUnit 7.x phar is not compatible with PHP 8 and won't be updated,
    192           # as PHPUnit 7 is no longer supported. The Composer-installed PHPUnit should be
    193           # used for PHP 8 testing instead.
    194           if [ ${{ env.LOCAL_PHP }} == '8.0-fpm' ]; then
    195             docker-compose run --rm php composer install --ignore-platform-reqs
    196             echo "PHPUNIT_SCRIPT=php-composer" >> $GITHUB_ENV
    197           else
    198             docker-compose run --rm php composer install
    199           fi
     223          docker-compose run --rm php composer install
    200224
    201225      - name: Docker debug information
     
    210234      # The memcached server needs to start after the Docker network has been set up with `npm run env:start`.
    211235      - name: Start the Memcached server.
    212         if: ${{ contains( matrix.php_versions, 'memcached' ) }}
     236        if: ${{ matrix.memcached }}
    213237        run: |
    214238          cp tests/phpunit/includes/object-cache.php build/wp-content/object-cache.php
     
    228252      - name: WordPress Docker container debug information
    229253        run: |
    230           docker -v
    231           docker-compose -v
    232254          docker-compose run --rm mysql mysql --version
    233255          docker-compose run --rm php php --version
     
    248270        run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml
    249271
    250       - name: Run mutlisite file tests
     272      - name: Run ms-files tests as a multisite install
    251273        run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --group ms-files
    252274
     
    257279        run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group restapi-jsclient
    258280
    259       # Xdebug supports PHP 8 only from version 3.0, which is not released yet.
    260       # Once Xdebug 3.0 is released and included in the Docker image, the IF condition should be removed.
    261281      # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
    262282      - name: Run (xDebug) tests
    263         if: ${{ env.LOCAL_PHP != '8.0-fpm' }}
    264283        run: LOCAL_PHP_XDEBUG=true npm run test:php -- -v --group xdebug --exclude-group __fakegroup__
    265284
    266       - name: WordPress Test Reporter
    267         if: ${{ matrix.php_versions == '7.4' }}
     285      - name: Checkout the WordPress Test Reporter
     286        if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/master' && matrix.report }}
    268287        uses: actions/checkout@v2
    269288        with:
    270289          repository: 'WordPress/phpunit-test-runner'
    271290          path: 'test-runner'
    272         # TODO: Configure hidden keys to successfully report test results.
    273         # 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
     291
     292      - name: Set up the Git repository
     293        if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/master' && matrix.report }}
     294        run: |
     295          git init
     296          git remote add origin https://github.com/WordPress/wordpress-develop.git
     297          git fetch
     298          git reset origin/master
     299
     300      - name: Submit test results to the WordPress.org host test results
     301        if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/master' && matrix.report }}
     302        env:
     303          WPT_REPORT_API_KEY: "${{ secrets.WPT_REPORT_API_KEY }}"
     304        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
  • branches/5.1/.github/workflows/verify-npm-on-windows.yml

    r49162 r50306  
    55    branches:
    66      - master
    7       - '*.*'
     7      - '3.[7-9]'
     8      - '[4-9].[0-9]'
    89  pull_request:
     10
     11env:
     12  PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
    913
    1014jobs:
     
    1216  #
    1317  # Performs the following steps:
    14   # - Cancels all previous workflow runs that have not completed.
     18  # - Cancels all previous workflow runs for pull requests that have not completed.
    1519  # - Checks out the repository.
    1620  # - Logs debug information about the runner container.
    17   # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches)
     21  # - Installs NodeJS 14.
    1822  # - Sets up caching for NPM.
    19   # _ Installs NPM dependencies.
     23  # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
    2024  # - Builds WordPress to run from the `build` directory.
    2125  test-npm:
    2226    name: Tests NPM on Windows
    2327    runs-on: windows-latest
     28    if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
     29
    2430    steps:
    25       - name: Cancel previous runs of this workflow
     31      - name: Cancel previous runs of this workflow (pull requests only)
     32        if: ${{ github.event_name == 'pull_request' }}
    2633        uses: styfle/cancel-workflow-action@0.5.0
    2734        with:
     
    4249        uses: actions/setup-node@v1
    4350        with:
    44           node-version: 12
     51          node-version: 14
    4552
    4653      - name: Get NPM cache directory
     
    5966
    6067      - name: Install Dependencies
    61         run: npm ci
     68        run: npx install-changed --install-command="npm ci"
    6269
    6370      - name: Build WordPress
  • branches/5.1/.github/workflows/welcome-new-contributors.yml

    r49162 r50306  
    22
    33on:
    4   pull_request:
     4  pull_request_target:
    55    types: [ opened ]
    66
    77jobs:
     8  # Comments on a pull request when the author is a new contributor.
    89  post-welcome-message:
    910    runs-on: ubuntu-latest
     11    if: ${{ github.repository == 'WordPress/wordpress-develop' }}
    1012
    1113    steps:
     
    2022
    2123
    22             It looks like this is your first pull request, so here are a few things to be aware of that may help you out.
     24            It looks like this is your first pull request to `wordpress-develop`. Here are a few things to be aware of that may help you out!
    2325
    2426
     
    2628
    2729
    28             **Pull requests are never merged on GitHub.** The WordPress codebase continues to be managed through the SVN repository that this one mirrors. But please feel free to use pull requests to work on any contribution you are making.
     30            **Pull requests are never merged on GitHub.** The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making.
    2931
    3032
     
    3234
    3335
    34             Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the [Automated Testing](https://make.wordpress.org/core/handbook/testing/automated-testing/) page in the handbook.
     36            **Please include automated tests.** Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the [Automated Testing](https://make.wordpress.org/core/handbook/testing/automated-testing/) page in the handbook.
    3537
    3638
     
    5355
    5456
    55             Please remember that the WordPress project is largely maintained by volunteers
    56 
    57 
    5857            Thank you,
    5958
  • branches/5.1/docker-compose.yml

    r49528 r50306  
    5454  ##
    5555  mysql:
    56     image: mysql:${LOCAL_MYSQL-5.7}
     56    image: ${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-5.7}
    5757
    5858    networks:
  • branches/5.1/tools/local-env/scripts/install.js

    r49528 r50306  
    2020// Move wp-config.php to the base directory, so it doesn't get mixed up in the src or build directories.
    2121renameSync( 'src/wp-config.php', 'wp-config.php' );
     22
     23install_wp_importer();
    2224
    2325// Read in wp-tests-config-sample.php, edit it to work with our config, then write it to wp-tests-config.php.
     
    4648    execSync( `docker-compose run --rm cli ${cmd}`, { stdio: 'inherit' } );
    4749}
     50
     51/**
     52 * Downloads the WordPress Importer plugin for use in tests.
     53 */
     54function install_wp_importer() {
     55    const test_plugin_directory = 'tests/phpunit/data/plugins/wordpress-importer';
     56
     57    execSync( `docker-compose exec -T php rm -rf ${test_plugin_directory} && svn checkout -r ${process.env.WP_IMPORTER_REVISION} https://plugins.svn.wordpress.org/wordpress-importer/trunk/ ${test_plugin_directory}`, { stdio: 'inherit' } );
     58}
Note: See TracChangeset for help on using the changeset viewer.