Changeset 58597
- Timestamp:
- 06/28/2024 06:40:36 PM (3 months ago)
- Location:
- branches/5.8
- Files:
-
- 2 added
- 1 deleted
- 13 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/5.8
- Property svn:mergeinfo changed
/trunk merged: 52179,53552,53895,56113-56114,57124-57125,57249,57918,58157
- Property svn:mergeinfo changed
-
branches/5.8/.github/workflows/coding-standards.yml
r55517 r58597 41 41 cancel-in-progress: true 42 42 43 # Disable permissions for all available scopes by default. 44 # Any needed permissions should be configured at the job level. 45 permissions: {} 46 43 47 jobs: 44 48 # Runs PHP coding standards checks. 45 #46 # Violations are reported inline with annotations.47 #48 # Performs the following steps:49 # - Checks out the repository.50 # - Sets up PHP.51 # - Logs debug information.52 # - Installs Composer dependencies (use cache if possible).53 # - Make Composer packages available globally.54 # - Logs PHP_CodeSniffer debug information.55 # - Runs PHPCS on the full codebase with warnings suppressed.56 # - Runs PHPCS on the `tests` directory without warnings suppressed.57 # - Ensures version-controlled files are not modified or deleted.58 # - todo: Configure Slack notifications for failing scans.59 49 phpcs: 60 50 name: PHP coding standards 61 runs-on: ubuntu-latest 62 timeout-minutes: 20 51 uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@trunk 52 permissions: 53 contents: read 63 54 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 64 65 steps: 66 - name: Checkout repository 67 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 68 69 - name: Set up PHP 70 uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0 71 with: 72 php-version: '7.4' 73 coverage: none 74 tools: composer, cs2pr 75 76 - name: Log debug information 77 run: | 78 php --version 79 composer --version 80 81 - name: Install Composer dependencies 82 uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0 83 with: 84 composer-options: "--no-progress --no-ansi" 85 86 - name: Make Composer packages available globally 87 run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH 88 89 - name: Log PHPCS debug information 90 run: phpcs -i 91 92 - name: Run PHPCS on all Core files 93 run: phpcs -q -n --report=checkstyle | cs2pr 94 95 - name: Check test suite files for warnings 96 run: phpcs tests -q --report=checkstyle | cs2pr 97 98 - name: Ensure version-controlled files are not modified during the tests 99 run: git diff --exit-code 55 with: 56 php-version: '7.4' 100 57 101 58 # Runs the JavaScript coding standards checks. 102 #103 # JSHint violations are not currently reported inline with annotations.104 #105 # Performs the following steps:106 # - Checks out the repository.107 # - Logs debug information about the GitHub Action runner.108 # - Installs Node.js.109 # - Logs updated debug information.110 # _ Installs npm dependencies.111 # - Run the WordPress JSHint checks.112 # - Ensures version-controlled files are not modified or deleted.113 59 jshint: 114 60 name: JavaScript coding standards 115 runs-on: ubuntu-latest 116 timeout-minutes: 20 61 uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk 62 permissions: 63 contents: read 117 64 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 118 env:119 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}120 121 steps:122 - name: Checkout repository123 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0124 125 - name: Log debug information126 run: |127 npm --version128 node --version129 git --version130 svn --version131 132 - name: Install Node.js133 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0134 with:135 node-version-file: '.nvmrc'136 cache: npm137 138 - name: Log debug information139 run: |140 npm --version141 node --version142 143 - name: Install Dependencies144 run: npm ci145 146 - name: Run JSHint147 run: npm run grunt jshint148 149 - name: Ensure version-controlled files are not modified or deleted150 run: git diff --exit-code151 65 152 66 slack-notifications: 153 67 name: Slack Notifications 154 68 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 69 permissions: 70 actions: read 71 contents: read 155 72 needs: [ phpcs, jshint ] 156 73 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} … … 166 83 name: Failed workflow tasks 167 84 runs-on: ubuntu-latest 85 permissions: 86 actions: write 168 87 needs: [ phpcs, jshint, slack-notifications ] 169 88 if: | … … 176 95 needs.jshint.result == 'cancelled' || needs.jshint.result == 'failure' 177 96 ) 178 179 97 steps: 180 98 - name: Dispatch workflow run 181 uses: actions/github-script@ 98814c53be79b1d30f795b907e553d8679345975 # v6.4.099 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 182 100 with: 183 101 retries: 2 -
branches/5.8/.github/workflows/end-to-end-tests.yml
r55517 r58597 27 27 cancel-in-progress: true 28 28 29 # Disable permissions for all available scopes by default. 30 # Any needed permissions should be configured at the job level. 31 permissions: {} 32 29 33 env: 30 34 LOCAL_DIR: build … … 32 36 jobs: 33 37 # Runs the end-to-end test suite. 34 #35 # Performs the following steps:36 # - Sets environment variables.37 # - Checks out the repository.38 # - Logs debug information about the GitHub Action runner.39 # - Installs Node.js.40 # _ Installs npm dependencies.41 # - Builds WordPress to run from the `build` directory.42 # - Starts the WordPress Docker container.43 # - Logs general debug information.44 # - Logs the running Docker containers.45 # - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container).46 # - Install WordPress within the Docker container.47 # - Run the E2E tests.48 # - Ensures version-controlled files are not modified or deleted.49 38 e2e-tests: 50 name: E2E Tests 51 runs-on: ubuntu-latest 52 timeout-minutes: 20 39 name: Test with SCRIPT_DEBUG ${{ matrix.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }} 40 uses: WordPress/wordpress-develop/.github/workflows/reusable-end-to-end-tests.yml@trunk 41 permissions: 42 contents: read 53 43 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 54 55 steps: 56 - name: Configure environment variables 57 run: | 58 echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV 59 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV 60 61 - name: Checkout repository 62 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 63 64 - name: Log debug information 65 run: | 66 npm --version 67 node --version 68 curl --version 69 git --version 70 svn --version 71 php --version 72 php -i 73 locale -a 74 75 - name: Install Node.js 76 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 77 with: 78 node-version-file: '.nvmrc' 79 cache: npm 80 81 - name: Install Dependencies 82 run: npm ci 83 84 - name: Build WordPress 85 run: npm run build 86 87 - name: Start Docker environment 88 run: | 89 npm run env:start 90 91 - name: General debug information 92 run: | 93 npm --version 94 node --version 95 curl --version 96 git --version 97 svn --version 98 99 - name: Log running Docker containers 100 run: docker ps -a 101 102 - name: Docker debug information 103 run: | 104 docker -v 105 docker-compose -v 106 docker-compose run --rm mysql mysql --version 107 docker-compose run --rm php php --version 108 docker-compose run --rm php php -m 109 docker-compose run --rm php php -i 110 docker-compose run --rm php locale -a 111 112 - name: Install WordPress 113 run: npm run env:install 114 115 - name: Run E2E tests 116 run: npm run test:e2e 117 118 - name: Ensure version-controlled files are not modified or deleted 119 run: git diff --exit-code 120 121 slack-notifications: 122 name: Slack Notifications 123 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 124 needs: [ e2e-tests ] 125 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} 44 strategy: 45 fail-fast: false 46 matrix: 47 LOCAL_SCRIPT_DEBUG: [ true, false ] 126 48 with: 127 calling_status: ${{ needs.e2e-tests.result == 'success' && 'success' || needs.e2e-tests.result == 'cancelled' && 'cancelled' || 'failure' }} 128 secrets: 129 SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} 130 SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} 131 SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} 132 SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} 49 LOCAL_SCRIPT_DEBUG: ${{ matrix.LOCAL_SCRIPT_DEBUG }} 50 php-version: '8.0' 51 install-gutenberg: false 133 52 134 53 failed-workflow: 135 54 name: Failed workflow tasks 136 55 runs-on: ubuntu-latest 137 needs: [ e2e-tests, slack-notifications ] 56 permissions: 57 actions: write 58 needs: [ e2e-tests ] 138 59 if: | 139 60 always() && … … 144 65 needs.e2e-tests.result == 'cancelled' || needs.e2e-tests.result == 'failure' 145 66 ) 146 147 67 steps: 148 68 - name: Dispatch workflow run 149 uses: actions/github-script@ 98814c53be79b1d30f795b907e553d8679345975 # v6.4.069 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 150 70 with: 151 71 retries: 2 -
branches/5.8/.github/workflows/javascript-tests.yml
r55517 r58597 39 39 cancel-in-progress: true 40 40 41 # Disable permissions for all available scopes by default. 42 # Any needed permissions should be configured at the job level. 43 permissions: {} 44 41 45 jobs: 42 # Runs the QUnit tests for WordPress. 43 # 44 # Performs the following steps: 45 # - Checks out the repository. 46 # - Logs debug information about the GitHub Action runner. 47 # - Installs Node.js. 48 # - Logs updated debug information. 49 # _ Installs npm dependencies. 50 # - Run the WordPress QUnit tests. 51 # - Ensures version-controlled files are not modified or deleted. 46 # Runs the WordPress Core JavaScript tests. 52 47 test-js: 53 48 name: QUnit Tests 54 runs-on: ubuntu-latest 55 timeout-minutes: 20 49 uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@trunk 50 permissions: 51 contents: read 56 52 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 57 58 steps:59 - name: Checkout repository60 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.061 62 - name: Log debug information63 run: |64 npm --version65 node --version66 git --version67 svn --version68 69 - name: Install Node.js70 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.071 with:72 node-version-file: '.nvmrc'73 cache: npm74 75 - name: Log debug information76 run: |77 npm --version78 node --version79 80 - name: Install Dependencies81 run: npm ci82 83 - name: Run QUnit tests84 run: npm run grunt qunit:compiled85 86 - name: Ensure version-controlled files are not modified or deleted87 run: git diff --exit-code88 53 89 54 slack-notifications: 90 55 name: Slack Notifications 91 56 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 57 permissions: 58 actions: read 59 contents: read 92 60 needs: [ test-js ] 93 61 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} 94 62 with: 95 calling_status: ${{ needs.test-js.result == 'success' && 'success' || needs.test-js.result == 'cancelled' && 'cancelled' || 'failure' }}63 calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} 96 64 secrets: 97 65 SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} … … 103 71 name: Failed workflow tasks 104 72 runs-on: ubuntu-latest 105 needs: [ test-js, slack-notifications ] 73 permissions: 74 actions: write 75 needs: [ slack-notifications ] 106 76 if: | 107 77 always() && … … 110 80 github.run_attempt < 2 && 111 81 ( 112 needs.test-js.result == 'cancelled' || needs.test-js.result == 'failure' 82 contains( needs.*.result, 'cancelled' ) || 83 contains( needs.*.result, 'failure' ) 113 84 ) 114 85 115 86 steps: 116 87 - name: Dispatch workflow run 117 uses: actions/github-script@ 98814c53be79b1d30f795b907e553d8679345975 # v6.4.088 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 118 89 with: 119 90 retries: 2 -
branches/5.8/.github/workflows/php-compatibility.yml
r55517 r58597 23 23 # These files configure Composer. Changes could affect the outcome. 24 24 - 'composer.*' 25 # This file configures PHP Compatibility scanning. Changes could affect the outcome.25 # This file configures PHP compatibility scanning. Changes could affect the outcome. 26 26 - 'phpcompat.xml.dist' 27 27 # Changes to workflow files should always verify all workflows are successful. … … 36 36 cancel-in-progress: true 37 37 38 # Disable permissions for all available scopes by default. 39 # Any needed permissions should be configured at the job level. 40 permissions: {} 41 38 42 jobs: 39 40 43 # Runs PHP compatibility testing. 41 #42 # Violations are reported inline with annotations.43 #44 # Performs the following steps:45 # - Checks out the repository.46 # - Sets up PHP.47 # - Logs debug information about the GitHub Action runner.48 # - Installs Composer dependencies (use cache if possible).49 # - Make Composer packages available globally.50 # - Logs PHP_CodeSniffer debug information.51 # - Runs the PHP compatibility tests.52 # - Ensures version-controlled files are not modified or deleted.53 # - todo: Configure Slack notifications for failing scans.54 44 php-compatibility: 55 45 name: Check PHP compatibility 56 runs-on: ubuntu-latest 57 timeout-minutes: 20 46 uses: WordPress/wordpress-develop/.github/workflows/reusable-php-compatibility.yml@trunk 47 permissions: 48 contents: read 58 49 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 59 60 steps: 61 - name: Checkout repository 62 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 63 64 - name: Set up PHP 65 uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0 66 with: 67 php-version: '7.4' 68 coverage: none 69 tools: composer, cs2pr 70 71 - name: Log debug information 72 run: | 73 php --version 74 composer --version 75 76 # This date is used to ensure that the PHP compatibility cache is cleared at least once every week. 77 # http://man7.org/linux/man-pages/man1/date.1.html 78 - name: "Get last Monday's date" 79 id: get-date 80 run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT 81 82 - name: Cache PHP compatibility scan cache 83 uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6 84 with: 85 path: .cache/phpcompat.json 86 key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }} 87 88 - name: Install Composer dependencies 89 uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0 90 with: 91 composer-options: "--no-progress --no-ansi" 92 93 - name: Make Composer packages available globally 94 run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH 95 96 - name: Log PHPCS debug information 97 run: phpcs -i 98 99 - name: Run PHP compatibility tests 100 run: phpcs --standard=phpcompat.xml.dist -q --report=checkstyle | cs2pr 101 102 - name: Ensure version-controlled files are not modified or deleted 103 run: git diff --exit-code 50 with: 51 php-version: '7.4' 104 52 105 53 slack-notifications: 106 54 name: Slack Notifications 107 55 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 56 permissions: 57 actions: read 58 contents: read 108 59 needs: [ php-compatibility ] 109 60 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} … … 119 70 name: Failed workflow tasks 120 71 runs-on: ubuntu-latest 72 permissions: 73 actions: write 121 74 needs: [ php-compatibility, slack-notifications ] 122 75 if: | … … 131 84 steps: 132 85 - name: Dispatch workflow run 133 uses: actions/github-script@ 98814c53be79b1d30f795b907e553d8679345975 # v6.4.086 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 134 87 with: 135 88 retries: 2 -
branches/5.8/.github/workflows/phpunit-tests.yml
r55517 r58597 27 27 cancel-in-progress: true 28 28 29 env: 30 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} 31 # Controls which npm script to use for running PHPUnit tests. Options ar `php` and `php-composer`. 32 PHPUNIT_SCRIPT: php 33 LOCAL_PHP_MEMCACHED: ${{ false }} 34 SLOW_TESTS: 'external-http,media,restapi' 29 # Disable permissions for all available scopes by default. 30 # Any needed permissions should be configured at the job level. 31 permissions: {} 35 32 36 33 jobs: 37 # Runs the PHPUnit tests for WordPress. 38 # 39 # Performs the following steps: 40 # - Sets environment variables. 41 # - Sets up the environment variables needed for testing with memcached (if desired). 42 # - Installs Node.js. 43 # - Installs npm dependencies 44 # - Configures caching for Composer. 45 # - Installs Composer dependencies. 46 # - Logs Docker debug information (about the Docker installation within the runner). 47 # - Starts the WordPress Docker container. 48 # - Starts the Memcached server after the Docker network has been created (if desired). 49 # - Logs general debug information about the runner. 50 # - Logs the running Docker containers. 51 # - Logs debug information from inside the WordPress Docker container. 52 # - Logs debug information about what's installed within the WordPress Docker containers. 53 # - Install WordPress within the Docker container. 54 # - Run the PHPUnit tests. 55 # - Ensures version-controlled files are not modified or deleted. 56 # - Checks out the WordPress Test reporter repository. 57 # - Reconnect the directory to the Git repository. 58 # - Submit the test results to the WordPress.org host test results. 34 # Creates PHPUnit test jobs. 59 35 test-php: 60 name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }} 61 runs-on: ${{ matrix.os }} 62 timeout-minutes: 20 36 name: PHP ${{ matrix.php }} 37 uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests-v2.yml@trunk 38 permissions: 39 contents: read 40 secrets: inherit 63 41 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 64 42 strategy: 65 43 fail-fast: false 66 44 matrix: 45 os: [ ubuntu-latest ] 67 46 php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ] 68 os: [ ubuntu-latest ] 47 multisite: [ false, true ] 48 split_slow: [ false ] 69 49 memcached: [ false ] 70 split_slow: [ false ]71 multisite: [ false, true ]72 50 include: 73 51 # Additional "slow" jobs for PHP 5.6. … … 97 75 multisite: false 98 76 report: true 99 env: 100 LOCAL_PHP: ${{ matrix.php }}-fpm 101 LOCAL_PHP_MEMCACHED: ${{ matrix.memcached }} 102 PHPUNIT_CONFIG: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }} 103 104 steps: 105 - name: Configure environment variables 106 run: | 107 echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV 108 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV 109 110 - name: Checkout repository 111 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 112 113 - name: Install Node.js 114 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 115 with: 116 node-version-file: '.nvmrc' 117 cache: npm 118 119 - name: Install npm dependencies 120 run: npm ci 121 122 - name: Get composer cache directory 123 id: composer-cache 124 run: echo "composer_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT 125 126 - name: Cache Composer dependencies 127 uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11 128 env: 129 cache-name: cache-composer-dependencies 130 with: 131 path: ${{ steps.composer-cache.outputs.composer_dir }} 132 key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} 133 134 - name: Install Composer dependencies 135 run: | 136 docker-compose run --rm php composer --version 137 138 # The PHPUnit 7.x phar is not compatible with PHP 8 and won't be updated, 139 # as PHPUnit 7 is no longer supported. The Composer-installed PHPUnit should be 140 # used for PHP 8 testing instead. 141 if [ ${{ env.LOCAL_PHP }} == '8.0-fpm' ]; then 142 docker-compose run --rm php composer install --ignore-platform-reqs 143 echo "PHPUNIT_SCRIPT=php-composer" >> $GITHUB_ENV 144 elif [ ${{ env.LOCAL_PHP }} == '7.1-fpm' ]; then 145 docker-compose run --rm php composer update 146 git checkout -- composer.lock 147 elif [[ ${{ env.LOCAL_PHP }} == '5.6-fpm' || ${{ env.LOCAL_PHP }} == '7.0-fpm' ]]; then 148 docker-compose run --rm php composer require --dev phpunit/phpunit:"^5.7" --update-with-dependencies 149 git checkout -- composer.lock composer.json 150 else 151 docker-compose run --rm php composer install 152 fi 153 154 - name: Docker debug information 155 run: | 156 docker -v 157 docker-compose -v 158 159 - name: Start Docker environment 160 run: | 161 npm run env:start 162 163 # The memcached server needs to start after the Docker network has been set up with `npm run env:start`. 164 - name: Start the Memcached server. 165 if: ${{ matrix.memcached }} 166 run: | 167 cp tests/phpunit/includes/object-cache.php src/wp-content/object-cache.php 168 docker run --name memcached --net $(basename "$PWD")_wpdevnet -d memcached 169 170 - name: General debug information 171 run: | 172 npm --version 173 node --version 174 curl --version 175 git --version 176 svn --version 177 178 - name: Log running Docker containers 179 run: docker ps -a 180 181 - name: WordPress Docker container debug information 182 run: | 183 docker-compose run --rm mysql mysql --version 184 docker-compose run --rm php php --version 185 docker-compose run --rm php php -m 186 docker-compose run --rm php php -i 187 docker-compose run --rm php locale -a 188 189 - name: Install WordPress 190 run: npm run env:install 191 192 - name: Run slow PHPUnit tests 193 if: ${{ matrix.split_slow }} 194 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }} 195 196 - name: Run PHPUnit tests for single site excluding slow tests 197 if: ${{ matrix.php < '7.0' && ! matrix.split_slow && ! matrix.multisite }} 198 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-required 199 200 - name: Run PHPUnit tests for Multisite excluding slow tests 201 if: ${{ matrix.php < '7.0' && ! matrix.split_slow && matrix.multisite }} 202 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-excluded,oembed-headers 203 204 - name: Run PHPUnit tests 205 if: ${{ matrix.php >= '7.0' }} 206 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} 207 208 - name: Run AJAX tests 209 if: ${{ ! matrix.split_slow }} 210 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax 211 212 - name: Run ms-files tests as a multisite install 213 if: ${{ matrix.multisite && ! matrix.split_slow }} 214 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --group ms-files 215 216 - name: Run external HTTP tests 217 if: ${{ ! matrix.multisite && ! matrix.split_slow }} 218 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group external-http 219 220 # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist. 221 - name: Run (xDebug) tests 222 if: ${{ ! matrix.split_slow }} 223 run: LOCAL_PHP_XDEBUG=true npm run test:${{ env.PHPUNIT_SCRIPT }} -- -v --group xdebug --exclude-group __fakegroup__ 224 225 - name: Ensure version-controlled files are not modified or deleted 226 run: git diff --exit-code 227 228 - name: Checkout the WordPress Test Reporter 229 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }} 230 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 231 with: 232 repository: 'WordPress/phpunit-test-runner' 233 path: 'test-runner' 234 235 - name: Submit test results to the WordPress.org host test results 236 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }} 237 env: 238 WPT_REPORT_API_KEY: "${{ secrets.WPT_REPORT_API_KEY }}" 239 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 77 with: 78 os: ${{ matrix.os }} 79 php: ${{ matrix.php }} 80 multisite: ${{ matrix.multisite }} 81 split_slow: ${{ matrix.split_slow }} 82 memcached: ${{ matrix.memcached }} 83 phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }} 84 report: ${{ matrix.report || false }} 240 85 241 86 slack-notifications: 242 87 name: Slack Notifications 243 88 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 89 permissions: 90 actions: read 91 contents: read 244 92 needs: [ test-php ] 245 93 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} 246 94 with: 247 calling_status: ${{ needs.test-php.result == 'success' && 'success' || needs.test-php.result == 'cancelled' && 'cancelled' || 'failure' }}95 calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} 248 96 secrets: 249 97 SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} … … 255 103 name: Failed workflow tasks 256 104 runs-on: ubuntu-latest 257 needs: [ test-php, slack-notifications ] 105 permissions: 106 actions: write 107 needs: [ slack-notifications ] 258 108 if: | 259 109 always() && … … 262 112 github.run_attempt < 2 && 263 113 ( 264 needs.test-php.result == 'cancelled' || needs.test-php.result == 'failure' 114 contains( needs.*.result, 'cancelled' ) || 115 contains( needs.*.result, 'failure' ) 265 116 ) 266 117 267 118 steps: 268 119 - name: Dispatch workflow run 269 uses: actions/github-script@ 98814c53be79b1d30f795b907e553d8679345975 # v6.4.0120 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 270 121 with: 271 122 retries: 2 -
branches/5.8/.github/workflows/test-build-processes.yml
r58596 r58597 1 name: Test npm1 name: Test Build Processes 2 2 3 3 on: … … 34 34 cancel-in-progress: true 35 35 36 env: 37 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} 36 # Disable permissions for all available scopes by default. 37 # Any needed permissions should be configured at the job level. 38 permissions: {} 38 39 39 40 jobs: 40 # Verifies that installing npm dependencies and building WordPress works as expected. 41 # 42 # Performs the following steps: 43 # - Checks out the repository. 44 # - Logs debug information about the GitHub Action runner. 45 # - Installs Node.js. 46 # _ Installs npm dependencies. 47 # - Builds WordPress to run from the `build` directory. 48 # - Cleans up after building WordPress to the `build` directory. 49 # - Ensures version-controlled files are not modified or deleted. 50 # - Builds WordPress to run from the `src` directory. 51 # - Cleans up after building WordPress to the `src` directory. 52 # - Ensures version-controlled files are not modified or deleted. 53 test-npm: 54 name: Test npm on ${{ matrix.os }} 55 runs-on: ${{ matrix.os }} 56 timeout-minutes: 20 41 # Tests the WordPress Core build process on multiple operating systems. 42 test-core-build-process: 43 name: Core running from ${{ matrix.directory }} 44 uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk 45 permissions: 46 contents: read 57 47 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 58 48 strategy: … … 60 50 matrix: 61 51 os: [ ubuntu-latest, windows-latest ] 52 directory: [ 'src', 'build' ] 53 include: 54 # Only prepare artifacts once. 55 - os: ubuntu-latest 56 directory: 'build' 57 prepare-playground: true 58 with: 59 os: ${{ matrix.os }} 60 directory: ${{ matrix.directory }} 61 prepare-playground: ${{ matrix.prepare-playground && matrix.prepare-playground || false }} 62 test-emoji: false 62 63 63 steps: 64 - name: Checkout repository 65 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 66 67 - name: Log debug information 68 run: | 69 npm --version 70 node --version 71 curl --version 72 git --version 73 svn --version 74 75 - name: Install Node.js 76 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 77 with: 78 node-version-file: '.nvmrc' 79 cache: npm 80 81 - name: Install Dependencies 82 run: npm ci 83 84 - name: Build WordPress 85 run: npm run build 86 87 - name: Clean after building 88 run: npm run grunt clean 89 90 - name: Ensure version-controlled files are not modified or deleted during building and cleaning 91 run: git diff --exit-code 92 93 # Verifies that installing npm dependencies and building WordPress works as expected on MacOS. 64 # Tests the WordPress Core build process on MacOS. 94 65 # 95 # This is separate from the job above in order to use stricter conditions aboutwhen to run.66 # This is separate from the job above in order to use stricter conditions when determining when to run. 96 67 # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate. 97 68 # … … 99 70 # currently no way to determine the OS being used on a given job. 100 71 # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. 101 # 102 # Performs the following steps: 103 # - Checks out the repository. 104 # - Logs debug information about the GitHub Action runner. 105 # - Installs Node.js. 106 # _ Installs npm dependencies. 107 # - Builds WordPress to run from the `build` directory. 108 # - Cleans up after building WordPress to the `build` directory. 109 # - Ensures version-controlled files are not modified or deleted. 110 # - Builds WordPress to run from the `src` directory. 111 # - Cleans up after building WordPress to the `src` directory. 112 # - Ensures version-controlled files are not modified or deleted. 113 test-npm-macos: 114 name: Test npm on MacOS 115 runs-on: macos-latest 116 timeout-minutes: 30 72 test-core-build-process-macos: 73 name: Core running from ${{ matrix.directory }} 74 uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk 75 permissions: 76 contents: read 117 77 if: ${{ github.repository == 'WordPress/wordpress-develop' }} 118 steps: 119 - name: Checkout repository 120 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 121 122 - name: Log debug information 123 run: | 124 npm --version 125 node --version 126 curl --version 127 git --version 128 svn --version 129 130 - name: Install Node.js 131 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 132 with: 133 node-version-file: '.nvmrc' 134 cache: npm 135 136 - name: Install Dependencies 137 run: npm ci 138 139 - name: Build WordPress 140 run: npm run build 141 142 - name: Clean after building 143 run: npm run grunt clean 144 145 - name: Ensure version-controlled files are not modified or deleted during building and cleaning 146 run: git diff --exit-code 147 148 - name: Build WordPress in /src 149 run: npm run build:dev 150 151 - name: Clean after building in /src 152 run: npm run grunt clean -- --dev 153 154 - name: Ensure version-controlled files are not modified or deleted during building and cleaning 155 run: git diff --exit-code 78 strategy: 79 fail-fast: false 80 matrix: 81 os: [ macos-13 ] 82 directory: [ 'src', 'build' ] 83 with: 84 os: ${{ matrix.os }} 85 directory: ${{ matrix.directory }} 86 test-emoji: false 156 87 157 88 slack-notifications: 158 89 name: Slack Notifications 159 90 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 160 needs: [ test-npm, test-npm-macos ] 91 permissions: 92 actions: read 93 contents: read 94 needs: [ test-core-build-process, test-core-build-process-macos ] 161 95 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} 162 96 with: 163 calling_status: ${{ needs.test-npm.result == 'success' && needs.test-npm-macos.result == 'success' && 'success' || ( needs.test-npm.result == 'cancelled' || needs.test-npm-macos.result == 'cancelled' ) && 'cancelled' || 'failure' }}97 calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} 164 98 secrets: 165 99 SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} … … 171 105 name: Failed workflow tasks 172 106 runs-on: ubuntu-latest 173 needs: [ test-npm, test-npm-macos, slack-notifications ] 107 permissions: 108 actions: write 109 needs: [ slack-notifications ] 174 110 if: | 175 111 always() && … … 178 114 github.run_attempt < 2 && 179 115 ( 180 needs.test-npm.result == 'cancelled' || needs.test-npm.result == 'failure'||181 needs.test-npm-macos.result == 'cancelled' || needs.test-npm-macos.result == 'failure'116 contains( needs.*.result, 'cancelled' ) || 117 contains( needs.*.result, 'failure' ) 182 118 ) 183 119 184 120 steps: 185 121 - name: Dispatch workflow run 186 uses: actions/github-script@ 98814c53be79b1d30f795b907e553d8679345975 # v6.4.0122 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 187 123 with: 188 124 retries: 2 -
branches/5.8/.gitignore
r51268 r58597 10 10 /.phpcs.xml 11 11 /phpcs.xml 12 *.cache/* 12 13 /tests/phpunit/data/plugins/wordpress-importer 13 14 /tests/phpunit/data/.trac-ticket-cache* -
branches/5.8/docker-compose.yml
r55517 r58597 1 version: '3.7'2 3 1 services: 4 2 … … 26 24 27 25 depends_on: 28 - php 26 php: 27 condition: service_started 28 mysql: 29 condition: service_healthy 29 30 30 31 ## … … 39 40 environment: 40 41 - LOCAL_PHP_XDEBUG=${LOCAL_PHP_XDEBUG-false} 42 - XDEBUG_MODE=${LOCAL_PHP_XDEBUG_MODE-develop,debug} 41 43 - LOCAL_PHP_MEMCACHED=${LOCAL_PHP_MEMCACHED-false} 42 44 - PHP_FPM_UID=${PHP_FPM_UID-1000} … … 47 49 - ./:/var/www 48 50 49 depends_on: 50 - mysql 51 # Copy or delete the Memcached dropin plugin file as appropriate. 52 command: /bin/sh -c "if [ $LOCAL_PHP_MEMCACHED = true ]; then cp -n /var/www/tests/phpunit/includes/object-cache.php /var/www/src/wp-content/object-cache.php; else rm -f /var/www/src/wp-content/object-cache.php; fi && exec php-fpm" 53 54 # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly. 55 init: true 56 57 extra_hosts: 58 - localhost:host-gateway 51 59 52 60 ## … … 54 62 ## 55 63 mysql: 56 image: amd64/${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-latest} 64 image: ${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-latest} 65 platform: linux/amd64 57 66 58 67 networks: … … 71 80 # For compatibility with PHP versions that don't support the caching_sha2_password auth plugin used in MySQL 8.0. 72 81 command: --default-authentication-plugin=mysql_native_password 82 83 healthcheck: 84 test: [ "CMD-SHELL", "if [ \"$LOCAL_DB_TYPE\" = \"mariadb\" ]; then mariadb-admin ping -h localhost; else mysqladmin ping -h localhost; fi" ] 85 timeout: 5s 86 interval: 5s 87 retries: 10 73 88 74 89 ## … … 92 107 # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly. 93 108 init: true 109 110 extra_hosts: 111 - localhost:host-gateway 112 113 depends_on: 114 php: 115 condition: service_started 116 mysql: 117 condition: service_healthy 94 118 95 119 ## … … 121 145 122 146 depends_on: 123 - mysql 147 php: 148 condition: service_started 149 mysql: 150 condition: service_healthy 151 152 ## 153 # The Memcached container. 154 ## 155 memcached: 156 image: memcached 157 158 networks: 159 - wpdevnet 160 161 ports: 162 - 11211:11211 163 164 depends_on: 165 php: 166 condition: service_started 124 167 125 168 volumes: -
branches/5.8/phpcompat.xml.dist
r47902 r58597 12 12 13 13 <!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. --> 14 <arg name="cache" />14 <arg name="cache" value=".cache/phpcompat.json"/> 15 15 16 16 <!-- Set the memory limit to 256M. -
branches/5.8/phpcs.xml.dist
r51122 r58597 7 7 8 8 <!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. --> 9 <arg name="cache" />9 <arg name="cache" value=".cache/phpcs.json"/> 10 10 11 11 <!-- Set the memory limit to 256M. -
branches/5.8/tools/local-env/scripts/docker.js
r49362 r58597 5 5 dotenvExpand( dotenv.config() ); 6 6 7 // Execute any docker -compose command passed to this script.8 execSync( 'docker -compose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );7 // Execute any docker compose command passed to this script. 8 execSync( 'docker compose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } ); -
branches/5.8/tools/local-env/scripts/install.js
r51179 r58597 46 46 */ 47 47 function wp_cli( cmd ) { 48 execSync( `docker -compose run --rm cli ${cmd}`, { stdio: 'inherit' } );48 execSync( `docker compose run --rm cli ${cmd}`, { stdio: 'inherit' } ); 49 49 } 50 50 … … 55 55 const testPluginDirectory = 'tests/phpunit/data/plugins/wordpress-importer'; 56 56 57 execSync( `docker -compose exec -T php rm -rf ${testPluginDirectory}`, { stdio: 'inherit' } );58 execSync( `docker -compose exec -T php git clone https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1`, { stdio: 'inherit' } );57 execSync( `docker compose exec -T php rm -rf ${testPluginDirectory}`, { stdio: 'inherit' } ); 58 execSync( `docker compose exec -T php git clone https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1`, { stdio: 'inherit' } ); 59 59 } -
branches/5.8/tools/local-env/scripts/start.js
r49362 r58597 6 6 7 7 // Start the local-env containers. 8 execSync( 'docker-compose up -d wordpress-develop', { stdio: 'inherit' } ); 8 const containers = ( process.env.LOCAL_PHP_MEMCACHED === 'true' ) 9 ? 'wordpress-develop memcached' 10 : 'wordpress-develop'; 11 execSync( `docker-compose up -d -- ${containers}`, { stdio: 'inherit' } ); 9 12 10 13 // If Docker Toolbox is being used, we need to manually forward LOCAL_PORT to the Docker VM.
Note: See TracChangeset
for help on using the changeset viewer.