Make WordPress Core

Ticket #50401: 50401.diff

File 50401.diff, 27.6 KB (added by desrosj, 4 years ago)
  • new file .github/workflows/coding-standards.yml

    diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml
    new file mode 100644
    index 0000000000..cd8f31d41a
    - +  
     1name: PHP Coding standards
     2
     3on:
     4  push:
     5  pull_request:
     6
     7jobs:
     8  # Runs PHP coding standards checks.
     9  #
     10  # Violations are reported inline with annotations.
     11  #
     12  # Performs the following steps:
     13  # - Checks out the repository.
     14  # - Configures caching for Composer.
     15  # - Sets up PHP.
     16  # - Logs debug information.
     17  # - Installs Composer dependencies (from cache if possible).
     18  # - Logs PHP_CodeSniffer debug information.
     19  # - Runs PHPCS tests.
     20  # - todo: Add a PHP_CodeSniffer scan for the `tests` directory that does not suppress warnings.
     21  # - todo: Configure Slack notifications for failing scans.
     22  phpcs:
     23    name: Check PHP coding standards
     24    runs-on: ubuntu-latest
     25    steps:
     26      - name: Checkout repository
     27        uses: actions/checkout@v2
     28
     29      - name: Get Composer cache directory
     30        id: composer-cache
     31        run: echo "::set-output name=dir::$(composer config cache-files-dir)"
     32
     33      - name: Set up Composer caching
     34        uses: actions/cache@v2
     35        env:
     36          cache-name: cache-composer-dependencies
     37        with:
     38          path: ${{ steps.composer-cache.outputs.dir }}
     39          key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
     40          restore-keys: |
     41            ${{ runner.os }}-composer-
     42
     43      - name: Set up PHP
     44        uses: shivammathur/setup-php@v2
     45        with:
     46          php-version: "latest"
     47          coverage: none
     48
     49      - name: Log debug information
     50        run: |
     51          php --version
     52          composer --version
     53
     54      - name: Install Composer dependencies
     55        run: |
     56          composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction
     57          echo "vendor/bin" >> $GITHUB_PATH
     58
     59      - name: Log PHPCS debug information
     60        run: phpcs -i
     61
     62      - name: Run PHPCS on Core files
     63        uses: wearerequired/lint-action@v1
     64        with:
     65          github_token: ${{ secrets.github_token }}
     66          check_name: PHP-Coding-Standards-${linter}
     67          php_codesniffer: true
     68          # Ignore warnings
     69          php_codesniffer_args: "-n"
  • new file .github/workflows/end-to-end-tests.yml

    diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml
    new file mode 100644
    index 0000000000..e5718481c3
    - +  
     1name: End-to-end Tests
     2
     3on:
     4  push:
     5  pull_request:
     6
     7env:
     8  LOCAL_DIR: build
     9  PHP_FPM_UID: 1001 # This needs to be dynamic
     10  PHP_FPM_GID: 116 # This needs to be dynamic
     11
     12jobs:
     13  # Runs the end-to-end test suite.
     14  #
     15  # Performs the following steps:
     16  # - Cancels all previous workflow runs that have not completed.
     17  # - Checks out the repository.
     18  # - Logs debug information about the runner container.
     19  # - Sets up caching for NPM.
     20  # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches)
     21  # _ Installs NPM dependencies.
     22  # - Builds WordPress to run from the `build` directory.
     23  # - Starts the WordPress Docker container.
     24  # - Logs general debug information.
     25  # - Logs the running Docker containers.
     26  # - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container)
     27  # - Install WordPress within the Docker container.
     28  # - Run the E2E tests.
     29  # - todo: Configure Slack notifications for failing tests.
     30  e2e-tests:
     31    name: E2E Tests
     32    runs-on: ubuntu-latest
     33    steps:
     34      - name: Cancel previous runs of this workflow
     35        uses: styfle/cancel-workflow-action@0.5.0
     36        with:
     37          access_token: ${{ github.token }}
     38
     39      - name: Checkout repository
     40        uses: actions/checkout@v2
     41
     42      - name: Log debug information
     43        run: |
     44          npm --version
     45          node --version
     46          curl --version
     47          git --version
     48          svn --version
     49          php --version
     50          php -i
     51          locale -a
     52
     53      - name: Cache NodeJS modules
     54        uses: actions/cache@v2
     55        env:
     56          cache-name: cache-node-modules
     57        with:
     58          # npm cache files are stored in `~/.npm` on Linux/macOS
     59          path: ~/.npm
     60          key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
     61          restore-keys: |
     62            ${{ runner.os }}-npm-
     63
     64      - name: Install NodeJS
     65        uses: actions/setup-node@v1
     66        with:
     67          node-version: 12
     68
     69      - name: Install Dependencies
     70        run: npm ci
     71
     72      - name: Build WordPress
     73        run: npm run build
     74
     75      - name: Start Docker environment
     76        run: |
     77          npm run env:start
     78
     79      - name: General debug information
     80        run: |
     81          npm --version
     82          node --version
     83          curl --version
     84          git --version
     85          svn --version
     86
     87      - name: Log running Docker containers
     88        run: docker ps -a
     89
     90      - name: Docker debug information
     91        run: |
     92          docker -v
     93          docker-compose -v
     94          docker-compose run --rm mysql mysql --version
     95          docker-compose run --rm php php --version
     96          docker-compose run --rm php php -m
     97          docker-compose run --rm php php -i
     98          docker-compose run --rm php locale -a
     99
     100      - name: Install WordPress
     101        run: npm run env:install
     102
     103      - name: Run E2E tests
     104        run: npm run test:e2e
  • new file .github/workflows/javascript-tests.yml

    diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml
    new file mode 100644
    index 0000000000..bbbbfe447e
    - +  
     1name: JavaScript Standards & Tests
     2
     3on:
     4  push:
     5  pull_request:
     6
     7jobs:
     8  # Runs the QUnit tests for WordPress.
     9  #
     10  # Performs the following steps:
     11  # - Cancels all previous workflow runs that have not completed.
     12  # - Checks out the repository.
     13  # - Logs debug information about the runner container.
     14  # - Sets up caching for NPM.
     15  # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches)
     16  # - Logs updated debug information.
     17  # _ Installs NPM dependencies.
     18  # - Run the WordPress JavaScript coding standards checks and QUnit tests.
     19  # - todo: Configure Slack notifications for failing tests.
     20  test-js:
     21    name: QUnit Tests
     22    runs-on: ubuntu-latest
     23    steps:
     24      - name: Cancel previous runs of this workflow
     25        uses: styfle/cancel-workflow-action@0.5.0
     26        with:
     27          access_token: ${{ github.token }}
     28
     29      - name: Checkout repository
     30        uses: actions/checkout@v2
     31
     32      - name: Log debug information
     33        run: |
     34          npm --version
     35          node --version
     36          git --version
     37          svn --version
     38
     39      - name: Cache NodeJS modules
     40        uses: actions/cache@v2
     41        env:
     42          cache-name: cache-node-modules
     43        with:
     44          # npm cache files are stored in `~/.npm` on Linux/macOS
     45          path: ~/.npm
     46          key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
     47          restore-keys: |
     48            ${{ runner.os }}-npm-
     49
     50      - name: Install NodeJS
     51        uses: actions/setup-node@v1
     52        with:
     53          node-version: 12
     54
     55      - name: Log debug information
     56        run: |
     57          npm --version
     58          node --version
     59
     60      - name: Install Dependencies
     61        run: npm ci
     62
     63      - name: Run QUnit tests
     64        run: npm run grunt travis:js
  • new file .github/workflows/php-compatibility-testing.yml

    diff --git a/.github/workflows/php-compatibility-testing.yml b/.github/workflows/php-compatibility-testing.yml
    new file mode 100644
    index 0000000000..07f47d4cdc
    - +  
     1name: PHP Compatibility
     2
     3on:
     4  push:
     5  pull_request:
     6
     7jobs:
     8
     9  # Runs PHP compatibility testing.
     10  #
     11  # Violations are reported inline with annotations.
     12  #
     13  # Performs the following steps:
     14  # - Checks out the repository.
     15  # - Configures caching for Composer.
     16  # - Sets up PHP.
     17  # - Logs debug information about the runner container.
     18  # - Installs Composer dependencies (from cache if possible).
     19  # - Logs PHP_CodeSniffer debug information.
     20  # - Runs the PHP compatibility tests.
     21  # - todo: Configure Slack notifications for failing scans.
     22  php-comatibility:
     23    name: Check PHP compatibility
     24    runs-on: ubuntu-latest
     25
     26    steps:
     27      - name: Checkout repository
     28        uses: actions/checkout@v2
     29
     30      - name: Get Composer cache directory
     31        id: composer-cache
     32        run: echo "::set-output name=dir::$(composer config cache-files-dir)"
     33
     34      - name: Set up Composer caching
     35        uses: actions/cache@v2
     36        env:
     37          cache-name: cache-composer-dependencies
     38        with:
     39          path: ${{ steps.composer-cache.outputs.dir }}
     40          key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
     41          restore-keys: |
     42            ${{ runner.os }}-composer-
     43
     44      - name: Set up PHP
     45        uses: shivammathur/setup-php@v2
     46        with:
     47          php-version: "latest"
     48          coverage: none
     49
     50      - name: Log debug information
     51        run: |
     52          php --version
     53          composer --version
     54
     55      - name: Install Composer dependencies
     56        run: |
     57          composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction
     58          echo "vendor/bin" >> $GITHUB_PATH
     59
     60      - name: Log PHPCS debug information
     61        run: phpcs -i
     62
     63      - name: Run PHP compatibility tests
     64        uses: wearerequired/lint-action@v1
     65        with:
     66          github_token: ${{ secrets.github_token }}
     67          check_name: PHP-Compatibility-${linter}
     68          php_codesniffer: true
     69          php_codesniffer_args: "--standard=phpcompat.xml.dist"
  • new file .github/workflows/test-wordpress.yml

    diff --git a/.github/workflows/test-wordpress.yml b/.github/workflows/test-wordpress.yml
    new file mode 100644
    index 0000000000..24a0b31fb6
    - +  
     1name: PHPUnit Tests
     2
     3on:
     4  push:
     5  pull_request:
     6  # Once weekly On Sundays at 00:00 UTC.
     7  schedule:
     8    - cron: '0 0 * * 0'
     9
     10env:
     11  LOCAL_DIR: build
     12  PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
     13  PHP_FPM_UID: 1001 # This needs to be dynamic
     14  PHP_FPM_GID: 116 # This needs to be dynamic
     15  COMPOSER_INSTALL: ${{ false }}
     16  # Controls which NPM script to use for running PHPUnit tests. Options are `php` and `php-composer`.
     17  PHPUNIT_SCRIPT: php
     18  LOCAL_PHP_MEMCACHED: ${{ false }}
     19
     20jobs:
     21  # Sets up WordPress for testing or development use.
     22  #
     23  # Performs the following steps:
     24  # - Cancels all previous workflow runs that have not completed.
     25  # - Checks out the repository.
     26  # - Checks out the WordPress Importer plugin (needed for the Core PHPUnit tests).
     27  # - Logs debug information about the runner container.
     28  # - Sets up caching for NPM.
     29  # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches)
     30  # _ Installs NPM dependencies.
     31  # - Builds WordPress to run from the `build` directory.
     32  # - Creates a ZIP file of compiled WordPress
     33  # - Uploads ZIP file as an artifact.
     34  setup-wordpress:
     35    name: Setup WordPress
     36    runs-on: ubuntu-latest
     37    steps:
     38      - name: Cancel previous runs of this workflow
     39        uses: styfle/cancel-workflow-action@0.5.0
     40        with:
     41          access_token: ${{ github.token }}
     42
     43      - name: Checkout repository
     44        uses: actions/checkout@v2
     45
     46      - name: Checkout the WordPress Importer plugin
     47        run: svn checkout -r 2387243 https://plugins.svn.wordpress.org/wordpress-importer/trunk/ tests/phpunit/data/plugins/wordpress-importer
     48
     49      - name: Log debug information
     50        run: |
     51          npm --version
     52          node --version
     53          curl --version
     54          git --version
     55          svn --version
     56          php --version
     57          php -i
     58          locale -a
     59
     60      - name: Cache NodeJS modules
     61        uses: actions/cache@v2
     62        env:
     63          cache-name: cache-node-modules
     64        with:
     65          # npm cache files are stored in `~/.npm` on Linux/macOS
     66          path: ~/.npm
     67          key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
     68          restore-keys: |
     69            ${{ runner.os }}-npm-
     70
     71      - name: Install NodeJS
     72        uses: actions/setup-node@v1
     73        with:
     74          node-version: 12
     75
     76      - name: Install Dependencies
     77        run: npm ci
     78
     79      - name: Build WordPress
     80        run: npm run build
     81
     82      - name: Create ZIP artifact
     83        uses: thedoctor0/zip-release@0.4.1
     84        with:
     85          filename: built-wp-${{ github.sha }}.zip
     86          exclusions: '/*node_modules/*'
     87
     88      - name: Upload build artifact
     89        uses: actions/upload-artifact@v2
     90        with:
     91          name: built-wp-${{ github.sha }}
     92          path: built-wp-${{ github.sha }}.zip
     93          if-no-files-found: error
     94
     95  # Runs the PHPUnit tests for WordPress.
     96  #
     97  # Performs the following steps:
     98  # - Downloads the built WordPress artifact from the previous job.
     99  # - Unzips the artifact.
     100  # - Sets up the environment variables needed for testing with memcached (if desired).
     101  # - Sets up caching for the NPM packages for the package-lock.json file (the cache from the previous job will be used
     102  #   if it was stored successfully).
     103  # - Installs NodeJS 12 (todo: install the version of NPM specified in the `nvmrc` file to support older branches)
     104  # _ Installs NPM dependencies.
     105  # - Configures caching for Composer.
     106  # _ Installs Composer dependencies (if desired)
     107  # - Logs Docker debug information (about both the Docker installation within the runner)
     108  # - Starts the WordPress Docker container.
     109  # - Starts the memcached server after the Docker network has been created (if desired).
     110  # - Logs WordPress Docker container debug information.
     111  # - Logs the running Docker containers.
     112  # - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container)  # - Install WordPress inside the WordPress Docker container.
     113  # - Install WordPress within the Docker container.
     114  # - Run the PHPUnit tests.
     115  # - Reports test results to the Distributed Hosting Tests.
     116  # - todo: Configure Slack notifications for failing tests.
     117  test-php:
     118    name: ${{ matrix.php_versions }} on ${{ matrix.os }} (PHPUnit)
     119    needs: setup-wordpress
     120    runs-on: ${{ matrix.os }}
     121    strategy:
     122      matrix:
     123        php_versions: [ '8.0', 7.4, '7.4 with memcached', 7.3, 7.2, 7.1, '7.0', 5.6.20 ]
     124        os: [ ubuntu-latest ]
     125    env:
     126      LOCAL_PHP: ${{ matrix.php_versions }}-fpm
     127
     128    steps:
     129      - name: Download the built WordPress artifact
     130        uses: actions/download-artifact@v2
     131        with:
     132          name: built-wp-${{ github.sha }}
     133
     134      - name: Unzip built artifact
     135        run: unzip built-wp-${{ github.sha }}.zip
     136
     137      - name: Configure memcached
     138        if: ${{ contains( matrix.php_versions, 'memcached' ) }}
     139        # TODO: Make LOCAL_PHP be the value of matrix.php_versions with memcached replaced with '-fpm'
     140        run: |
     141          echo "LOCAL_PHP=latest" >> $GITHUB_ENV
     142          echo "LOCAL_PHP_MEMCACHED=true" >> $GITHUB_ENV
     143
     144      - name: Use cached Node modules
     145        uses: actions/cache@v2
     146        env:
     147          cache-name: cache-node-modules
     148        with:
     149          # npm cache files are stored in `~/.npm` on Linux/macOS
     150          path: ~/.npm
     151          key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
     152          restore-keys: |
     153            ${{ runner.os }}-npm-
     154
     155      - name: Install NodeJS
     156        uses: actions/setup-node@v1
     157        with:
     158          node-version: 12
     159
     160      - name: Install Dependencies
     161        run: npm ci
     162
     163      - name: Get composer cache directory
     164        id: composer-cache
     165        if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }}
     166        run: echo "::set-output name=dir::$(composer config cache-files-dir)"
     167
     168      - name: Cache Composer dependencies
     169        if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }}
     170        uses: actions/cache@v2
     171        env:
     172          cache-name: cache-composer-dependencies
     173        with:
     174          path: ${{ steps.composer-cache.outputs.dir }}
     175          key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
     176          restore-keys: |
     177            ${{ runner.os }}-composer-
     178
     179      - name: Install Composer dependencies
     180        if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }}
     181        run: |
     182          docker-compose run --rm php composer --version
     183
     184          # The PHPUnit 7.x phar is not compatible with PHP 8 and won't be updated,
     185          # as PHPUnit 7 is no longer supported. The Composer-installed PHPUnit should be
     186          # used for PHP 8 testing instead.
     187          if [ ${{ env.LOCAL_PHP }} == '8.0-fpm' ]; then
     188            docker-compose run --rm php composer install --ignore-platform-reqs
     189            echo "PHPUNIT_SCRIPT=php-composer" >> $GITHUB_ENV
     190          else
     191            docker-compose run --rm php composer install
     192          fi
     193
     194      - name: Docker debug information
     195        run: |
     196          docker -v
     197          docker-compose -v
     198
     199      - name: Start Docker environment
     200        run: |
     201          npm run env:start
     202
     203      # The memcached server needs to start after the Docker network has been set up with `npm run env:start`.
     204      - name: Start the Memcached server.
     205        if: ${{ contains( matrix.php_versions, 'memcached' ) }}
     206        run: |
     207          cp tests/phpunit/includes/object-cache.php build/wp-content/object-cache.php
     208          docker run --name memcached --net $(basename "$PWD")_wpdevnet -d memcached
     209
     210      - name: General debug information
     211        run: |
     212          npm --version
     213          node --version
     214          curl --version
     215          git --version
     216          svn --version
     217
     218      - name: Log running Docker containers
     219        run: docker ps -a
     220
     221      - name: WordPress Docker container debug information
     222        run: |
     223          docker -v
     224          docker-compose -v
     225          docker-compose run --rm mysql mysql --version
     226          docker-compose run --rm php php --version
     227          docker-compose run --rm php php -m
     228          docker-compose run --rm php php -i
     229          docker-compose run --rm php locale -a
     230
     231      - name: Install WordPress
     232        run: npm run env:install
     233
     234      - name: Run PHPUnit tests
     235        run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist
     236
     237      - name: Run AJAX tests
     238        run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group ajax
     239
     240      - name: Run tests as a multisite install
     241        run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml
     242
     243      - name: Run mutlisite file tests
     244        run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --group ms-files
     245
     246      - name: Run external HTTP tests
     247        run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group external-http
     248
     249      - name: Run REST API tests
     250        run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group restapi-jsclient
     251
     252      # Xdebug supports PHP 8 only from version 3.0, which is not released yet.
     253      # Once Xdebug 3.0 is released and included in the Docker image, the IF condition should be removed.
     254      # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
     255      - name: Run (xDebug) tests
     256        if: ${{ env.LOCAL_PHP != '8.0-fpm' }}
     257        run: LOCAL_PHP_XDEBUG=true npm run test:php -- -v --group xdebug --exclude-group __fakegroup__
     258
     259      - name: WordPress Test Reporter
     260        if: ${{ matrix.php_versions == '7.4' }}
     261        uses: actions/checkout@v2
     262        with:
     263          repository: 'WordPress/phpunit-test-runner'
     264          path: 'test-runner'
     265        # TODO: Configure hidden keys to successfully report test results.
     266        # 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
  • new file .github/workflows/verify-npm-windows.yml

    diff --git a/.github/workflows/verify-npm-windows.yml b/.github/workflows/verify-npm-windows.yml
    new file mode 100644
    index 0000000000..bf10f6f998
    - +  
     1name: Test NPM on Windows
     2
     3on:
     4  push:
     5  pull_request:
     6
     7jobs:
     8  # Verifies that installing NPM dependencies and building WordPress works on Windows.
     9  #
     10  # Performs the following steps:
     11  # - Cancels all previous workflow runs that have not completed.
     12  # - Checks out the repository.
     13  # - Logs debug information about the runner container.
     14  # - Sets up caching for NPM.
     15  # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches)
     16  # _ Installs NPM dependencies.
     17  # - Builds WordPress to run from the `build` directory.
     18  test-npm:
     19    name: Tests NPM on Windows
     20    runs-on: windows-latest
     21    steps:
     22      - name: Cancel previous runs of this workflow
     23        uses: styfle/cancel-workflow-action@0.5.0
     24        with:
     25          access_token: ${{ github.token }}
     26
     27      - name: Checkout repository
     28        uses: actions/checkout@v2
     29
     30      - name: Log debug information
     31        run: |
     32          npm --version
     33          node --version
     34          curl --version
     35          git --version
     36          svn --version
     37
     38      - name: Get NPM cache directory
     39        id: npm-cache
     40        run: echo "::set-output name=dir::$(npm config get cache)"
     41
     42      - name: Cache NodeJS modules
     43        uses: actions/cache@v2
     44        env:
     45          cache-name: cache-node-modules
     46        with:
     47          path: ${{ steps.npm-cache.outputs.dir }}
     48          key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
     49          restore-keys: |
     50            ${{ runner.os }}-npm-
     51
     52      - name: Install NodeJS
     53        uses: actions/setup-node@v1
     54        with:
     55          node-version: 12
     56
     57      - name: Install Dependencies
     58        run: npm ci
     59
     60      - name: Build WordPress
     61        run: npm run build
  • new file .github/workflows/welcome-new-contributors.yml

    diff --git a/.github/workflows/welcome-new-contributors.yml b/.github/workflows/welcome-new-contributors.yml
    new file mode 100644
    index 0000000000..1f71762d09
    - +  
     1name: Welcome New Contributors
     2
     3on:
     4  pull_request:
     5    types:
     6      - opened
     7
     8jobs:
     9  post-welcome-message:
     10    runs-on: ubuntu-latest
     11
     12    steps:
     13      - uses: bubkoo/welcome-action@v1
     14        with:
     15          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
     16          FIRST_PR_COMMENT: >
     17            Hi @{{ author }}! 👋
     18
     19            Thank you for your contribution to WordPress! 💖
     20
     21            It looks like this is your first pull request, so here are a few things to be aware of that may help you out.
     22
     23            **No one monitors this repository for new pull requests.** Pull requests **must** be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, simply include the ticket's full URL in your pull request description.
     24
     25            **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.
     26
     27            More information about how GitHub pull requests can be used to contribute to WordPress can be found in [this blog post](https://make.wordpress.org/core/2020/02/21/working-on-trac-tickets-using-github-pull-requests/).
     28
     29            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.
     30
     31            If you have not had a chance, please review the [Contribute with Code page](https://make.wordpress.org/core/handbook/contribute/) in the [WordPress Core Handbook](https://make.wordpress.org/core/handbook/).
     32
     33            The [Developer Hub](https://developer.wordpress.org/) also documents the various [coding standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/) that are followed:
     34            - [PHP Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/)
     35            - [CSS Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/css/)
     36            - [HTML Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/html/)
     37            - [JavaScript Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/)
     38            - [Accessibility Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/accessibility/)
     39            - [Inline Documentation Standards](https://developer.wordpress.org/coding-standards/inline-documentation-standards/)
     40
     41            Please remember that the WordPress project is largely maintained by volunteers
     42
     43            Thank you,
     44            The WordPress Project
  • phpcompat.xml.dist

    diff --git a/phpcompat.xml.dist b/phpcompat.xml.dist
    index 5af8e2a503..1254643e16 100644
    a b  
    3131        <!-- For now, only the files in src are scanned. -->
    3232        <file>./src/</file>
    3333
     34        <!--
     35                Explicitly exclude the tests directory from being scanned.
     36
     37                Even though `src` is defined as the only directory to scan, the `tests` directory is still
     38                being included in scans within GitHub actions. This happens because wearerequired/lint-action hard codes `.`
     39                as the directory to scan within the `phpcs` command.
     40
     41                See: https://github.com/wearerequired/lint-action/blob/153bc60ada5996904238672b9e4e7015139c3711/src/linters/php-codesniffer.js#L48.
     42        -->
     43        <exclude-pattern>/tests</exclude-pattern>
     44
    3445        <!-- Code which doesn't go into production may have different requirements. -->
    3546        <exclude-pattern>/node_modules/*</exclude-pattern>
    3647
  • src/wp-includes/functions.php

    diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
    index f46fc6ea65..e764310b27 100644
    a b function mysql2date( $format, $date, $translate = true ) { 
    3434
    3535        $datetime = date_create( $date, wp_timezone() );
    3636
    37         if ( false === $datetime ) {
     37        if (false === $datetime) {
    3838                return false;
    3939        }
    4040
    4141        // Returns a sum of timestamp with timezone offset. Ideally should never be used.
    42         if ( 'G' === $format || 'U' === $format ) {
     42        if ( 'G'===$format || 'U' === $format ) {
    4343                return $datetime->getTimestamp() + $datetime->getOffset();
    4444        }
    4545
    function date_i18n( $format, $timestamp_with_offset = false, $gmt = false ) { 
    166166        $timestamp = $timestamp_with_offset;
    167167
    168168        // If timestamp is omitted it should be current time (summed with offset, unless `$gmt` is true).
    169         if ( ! is_numeric( $timestamp ) ) {
     169        if ( ! is_numeric( $timestamp ) )
    170170                $timestamp = current_time( 'timestamp', $gmt );
    171         }
     171
    172172
    173173        /*
    174174         * This is a legacy implementation quirk that the returned timestamp is also with offset.
    function mbstring_binary_safe_encoding( $reset = false ) { 
    66746674        static $overloaded = null;
    66756675
    66766676        if ( is_null( $overloaded ) ) {
    6677                 $overloaded = function_exists( 'mb_internal_encoding' ) && ( ini_get( 'mbstring.func_overload' ) & 2 ); // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated
     6677                $overloaded = function_exists( 'mb_internal_encoding' ) && ( ini_get( 'mbstring.func_overload' ) & 2 );
    66786678        }
    66796679
    66806680        if ( false === $overloaded ) {