Changeset 58358
- Timestamp:
- 06/06/2024 04:34:11 PM (7 weeks ago)
- Location:
- branches/5.9
- Files:
-
- 10 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/5.9
- Property svn:mergeinfo changed
/trunk merged: 53552,53895,56113-56114,57124-57125,57249,57918,58157
- Property svn:mergeinfo changed
-
branches/5.9/.github/workflows/coding-standards.yml
r55516 r58358 41 41 cancel-in-progress: true 42 42 43 44 45 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 # - Configures caching for PHPCS scans.53 # - Installs Composer dependencies (use cache if possible).54 # - Make Composer packages available globally.55 # - Logs PHP_CodeSniffer debug information.56 # - Runs PHPCS on the full codebase with warnings suppressed.57 # - Runs PHPCS on the `tests` directory without warnings suppressed.58 # - Ensures version-controlled files are not modified or deleted.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 # This date is used to ensure that the PHPCS cache is cleared at least once every week. 82 # http://man7.org/linux/man-pages/man1/date.1.html 83 - name: "Get last Monday's date" 84 id: get-date 85 run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT 86 87 - name: Cache PHPCS scan cache 88 uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6 89 with: 90 path: .cache/phpcs.json 91 key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }} 92 93 - name: Install Composer dependencies 94 uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0 95 with: 96 composer-options: "--no-progress --no-ansi" 97 98 - name: Make Composer packages available globally 99 run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH 100 101 - name: Log PHPCS debug information 102 run: phpcs -i 103 104 - name: Run PHPCS on all Core files 105 run: phpcs -q -n --report=checkstyle | cs2pr 106 107 - name: Check test suite files for warnings 108 run: phpcs tests -q --report=checkstyle | cs2pr 109 110 - name: Ensure version-controlled files are not modified during the tests 111 run: git diff --exit-code 55 with: 56 php-version: '7.4' 112 57 113 58 # Runs the JavaScript coding standards checks. 114 #115 # JSHint violations are not currently reported inline with annotations.116 #117 # Performs the following steps:118 # - Checks out the repository.119 # - Logs debug information about the GitHub Action runner.120 # - Installs Node.js.121 # - Logs updated debug information.122 # _ Installs npm dependencies.123 # - Run the WordPress JSHint checks.124 # - Ensures version-controlled files are not modified or deleted.125 59 jshint: 126 60 name: JavaScript coding standards 127 runs-on: ubuntu-latest 128 timeout-minutes: 20 61 uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk 62 permissions: 63 contents: read 129 64 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 130 env:131 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}132 133 steps:134 - name: Checkout repository135 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0136 137 - name: Log debug information138 run: |139 npm --version140 node --version141 git --version142 svn --version143 144 - name: Install Node.js145 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0146 with:147 node-version-file: '.nvmrc'148 cache: npm149 150 - name: Log debug information151 run: |152 npm --version153 node --version154 155 - name: Install Dependencies156 run: npm ci157 158 - name: Run JSHint159 run: npm run grunt jshint160 161 - name: Ensure version-controlled files are not modified or deleted162 run: git diff --exit-code163 65 164 66 slack-notifications: 165 67 name: Slack Notifications 166 68 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 69 70 71 167 72 needs: [ phpcs, jshint ] 168 73 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} … … 178 83 name: Failed workflow tasks 179 84 runs-on: ubuntu-latest 85 86 180 87 needs: [ phpcs, jshint, slack-notifications ] 181 88 if: | -
branches/5.9/.github/workflows/end-to-end-tests.yml
r57201 r58358 27 27 cancel-in-progress: true 28 28 29 30 31 32 29 33 env: 30 34 LOCAL_DIR: build 31 LOCAL_PHP: 8.0-fpm32 35 33 36 jobs: 34 37 # Runs the end-to-end test suite. 35 #36 # Performs the following steps:37 # - Sets environment variables.38 # - Checks out the repository.39 # - Logs debug information about the GitHub Action runner.40 # - Installs Node.js.41 # _ Installs npm dependencies.42 # - Builds WordPress to run from the `build` directory.43 # - Starts the WordPress Docker container.44 # - Logs general debug information.45 # - Logs the running Docker containers.46 # - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container).47 # - Install WordPress within the Docker container.48 # - Run the E2E tests.49 # - Ensures version-controlled files are not modified or deleted.50 38 e2e-tests: 51 name: E2E Tests 52 runs-on: ubuntu-latest 53 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 54 43 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 55 56 steps: 57 - name: Configure environment variables 58 run: | 59 echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV 60 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV 61 62 - name: Checkout repository 63 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 64 65 - name: Log debug information 66 run: | 67 npm --version 68 node --version 69 curl --version 70 git --version 71 svn --version 72 php --version 73 php -i 74 locale -a 75 76 - name: Install Node.js 77 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 78 with: 79 node-version-file: '.nvmrc' 80 cache: npm 81 82 - name: Install Dependencies 83 run: npm ci 84 85 - name: Build WordPress 86 run: npm run build 87 88 - name: Start Docker environment 89 run: | 90 npm run env:start 91 92 - name: General debug information 93 run: | 94 npm --version 95 node --version 96 curl --version 97 git --version 98 svn --version 99 100 - name: Log running Docker containers 101 run: docker ps -a 102 103 - name: Docker debug information 104 run: | 105 docker -v 106 docker-compose -v 107 docker-compose run --rm mysql mysql --version 108 docker-compose run --rm php php --version 109 docker-compose run --rm php php -m 110 docker-compose run --rm php php -i 111 docker-compose run --rm php locale -a 112 113 - name: Install WordPress 114 run: npm run env:install 115 116 - name: Run E2E tests 117 run: npm run test:e2e 118 119 - name: Ensure version-controlled files are not modified or deleted 120 run: git diff --exit-code 121 122 slack-notifications: 123 name: Slack Notifications 124 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 125 needs: [ e2e-tests ] 126 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 ] 127 48 with: 128 calling_status: ${{ needs.e2e-tests.result == 'success' && 'success' || needs.e2e-tests.result == 'cancelled' && 'cancelled' || 'failure' }} 129 secrets: 130 SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} 131 SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} 132 SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} 133 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 134 52 135 53 failed-workflow: 136 54 name: Failed workflow tasks 137 55 runs-on: ubuntu-latest 138 needs: [ e2e-tests, slack-notifications ] 56 permissions: 57 actions: write 58 needs: [ e2e-tests ] 139 59 if: | 140 60 always() && … … 145 65 needs.e2e-tests.result == 'cancelled' || needs.e2e-tests.result == 'failure' 146 66 ) 147 148 67 steps: 149 68 - name: Dispatch workflow run -
branches/5.9/.github/workflows/javascript-tests.yml
r55516 r58358 39 39 cancel-in-progress: true 40 40 41 42 43 44 41 45 jobs: 42 46 # 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.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 58 59 92 60 needs: [ test-js ] 93 61 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} … … 103 71 name: Failed workflow tasks 104 72 runs-on: ubuntu-latest 73 74 105 75 needs: [ test-js, slack-notifications ] 106 76 if: | -
branches/5.9/.github/workflows/php-compatibility.yml
r55516 r58358 36 36 cancel-in-progress: true 37 37 38 39 40 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.48 # - Configures caching for PHP compatibility scans.49 # - Installs Composer dependencies (use cache if possible).50 # - Make Composer packages available globally.51 # - Logs PHP_CodeSniffer debug information.52 # - Runs the PHP compatibility tests.53 # - Ensures version-controlled files are not modified or deleted.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 57 58 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 73 121 74 needs: [ php-compatibility, slack-notifications ] 122 75 if: | -
branches/5.9/.github/workflows/phpunit-tests.yml
r55516 r58358 27 27 cancel-in-progress: true 28 28 29 env: 30 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} 31 LOCAL_PHP_MEMCACHED: ${{ false }}32 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 } 32 33 33 34 34 jobs: 35 # Runs the PHPUnit tests for WordPress.36 35 # 37 # Note: Steps running tests for PHP 8.1 jobs are allowed to "continue-on-error". 38 # This prevents workflow runs from being marked as "failed" when only PHP 8.1 fails. 36 # Creates a PHPUnit test job for each PHP/MySQL combination. 39 37 # 40 # Performs the following steps:41 # - Sets environment variables.42 # - Sets up the environment variables needed for testing with memcached (if desired).43 # - Installs Node.js.44 # - Installs npm dependencies45 # - Configures caching for Composer.46 # - Installs Composer dependencies.47 # - Logs Docker debug information (about the Docker installation within the runner).48 # - Starts the WordPress Docker container.49 # - Starts the Memcached server after the Docker network has been created (if desired).50 # - Logs general debug information about the runner.51 # - Logs the running Docker containers.52 # - Logs debug information from inside the WordPress Docker container.53 # - Logs debug information about what's installed within the WordPress Docker containers.54 # - Install WordPress within the Docker container.55 # - Run the PHPUnit tests.56 # - Ensures version-controlled files are not modified or deleted.57 # - Checks out the WordPress Test reporter repository.58 # - Reconnect the directory to the Git repository.59 # - Submit the test results to the WordPress.org host test results.60 38 test-php: 61 name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }} 62 runs-on: ${{ matrix.os }} 63 timeout-minutes: 20 39 name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }} 40 uses: WordPress/wordpress-develop/.github/workflows/reusable-phpunit-tests.yml@trunk 41 permissions: 42 contents: read 43 secrets: inherit 64 44 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 65 45 strategy: 66 46 fail-fast: false 67 47 matrix: 48 68 49 php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ] 69 os: [ ubuntu-latest ] 50 db-type: [ 'mysql' ] 51 db-version: [ '5.7' ] 52 multisite: [ false, true ] 70 53 memcached: [ false ] 71 split_slow: [ false ] 72 multisite: [ false, true ] 54 73 55 include: 74 # Additional "slow" jobs for PHP 5.6. 75 - php: '5.6' 76 os: ubuntu-latest 56 # Allow PHP 8.1 tests to have errors. 57 - php: '8.1' 58 allow-errors: true 59 # Include jobs for PHP 7.4 with memcached. 60 - os: ubuntu-latest 61 php: '7.4' 62 db-type: 'mysql' 63 db-version: '5.7' 64 multisite: false 65 memcached: true 66 - os: ubuntu-latest 67 php: '7.4' 68 db-type: 'mysql' 69 db-version: '5.7' 70 multisite: true 71 memcached: true 72 # Report the results of the PHP 7.4 without memcached job. 73 - os: ubuntu-latest 74 php: '7.4' 75 db-type: 'mysql' 76 db-version: '5.7' 77 multisite: false 77 78 memcached: false 78 multisite: false79 split_slow: true80 - php: '5.6'81 os: ubuntu-latest82 memcached: false83 multisite: true84 split_slow: true85 # Include jobs for PHP 7.4 with memcached.86 - php: '7.4'87 os: ubuntu-latest88 memcached: true89 multisite: false90 - php: '7.4'91 os: ubuntu-latest92 memcached: true93 multisite: true94 # Report the results of the PHP 7.4 without memcached job.95 - php: '7.4'96 os: ubuntu-latest97 memcached: false98 multisite: false99 79 report: true 100 101 env: 102 LOCAL_PHP: ${{ matrix.php }}-fpm 103 LOCAL_PHP_MEMCACHED: ${{ matrix.memcached }} 104 PHPUNIT_CONFIG: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }} 105 106 steps: 107 - name: Configure environment variables 108 run: | 109 echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV 110 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV 111 112 - name: Checkout repository 113 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 114 115 - name: Install Node.js 116 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 117 with: 118 node-version-file: '.nvmrc' 119 cache: npm 120 121 - name: Install npm dependencies 122 run: npm ci 123 124 # This date is used to ensure that the Composer cache is refreshed at least once every week. 125 # http://man7.org/linux/man-pages/man1/date.1.html 126 - name: "Get last Monday's date" 127 id: get-date 128 run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT 129 130 - name: Get Composer cache directory 131 id: composer-cache 132 run: echo "composer_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT 133 134 - name: Cache Composer dependencies 135 uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3 136 env: 137 cache-name: cache-composer-dependencies 138 with: 139 path: ${{ steps.composer-cache.outputs.composer_dir }} 140 key: ${{ runner.os }}-php-${{ matrix.php }}-date-${{ steps.get-date.outputs.date }}-composer-${{ hashFiles('**/composer.json') }} 141 142 - name: Install Composer dependencies 143 run: | 144 docker-compose run --rm php composer --version 145 146 # Install using `composer update` as there is no `composer.lock` file. 147 if [ ${{ env.LOCAL_PHP }} == '8.1-fpm' ]; then 148 docker-compose run --rm php composer update --ignore-platform-reqs 149 else 150 docker-compose run --rm php composer update 151 fi 152 153 - name: Docker debug information 154 run: | 155 docker -v 156 docker-compose -v 157 158 - name: Start Docker environment 159 run: | 160 npm run env:start 161 162 # The memcached server needs to start after the Docker network has been set up with `npm run env:start`. 163 - name: Start the Memcached server. 164 if: ${{ matrix.memcached }} 165 run: | 166 cp tests/phpunit/includes/object-cache.php src/wp-content/object-cache.php 167 docker run --name memcached --net $(basename "$PWD")_wpdevnet -d memcached 168 169 - name: General debug information 170 run: | 171 npm --version 172 node --version 173 curl --version 174 git --version 175 svn --version 176 177 - name: Log running Docker containers 178 run: docker ps -a 179 180 - name: WordPress Docker container debug information 181 run: | 182 docker-compose run --rm mysql mysql --version 183 docker-compose run --rm php php --version 184 docker-compose run --rm php php -m 185 docker-compose run --rm php php -i 186 docker-compose run --rm php locale -a 187 188 - name: Install WordPress 189 run: npm run env:install 190 191 - name: Run slow PHPUnit tests 192 if: ${{ matrix.split_slow }} 193 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }} 194 195 - name: Run PHPUnit tests for single site excluding slow tests 196 if: ${{ matrix.php < '7.0' && ! matrix.split_slow && ! matrix.multisite }} 197 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-required 198 199 - name: Run PHPUnit tests for Multisite excluding slow tests 200 if: ${{ matrix.php < '7.0' && ! matrix.split_slow && matrix.multisite }} 201 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-excluded,oembed-headers 202 203 - name: Run PHPUnit tests 204 if: ${{ matrix.php >= '7.0' }} 205 continue-on-error: ${{ matrix.php == '8.1' }} 206 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} 207 208 - name: Run AJAX tests 209 if: ${{ ! matrix.split_slow }} 210 continue-on-error: ${{ matrix.php == '8.1' }} 211 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax 212 213 - name: Run ms-files tests as a multisite install 214 if: ${{ matrix.multisite && ! matrix.split_slow }} 215 continue-on-error: ${{ matrix.php == '8.1' }} 216 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml --group ms-files 217 218 - name: Run external HTTP tests 219 if: ${{ ! matrix.multisite && ! matrix.split_slow }} 220 continue-on-error: ${{ matrix.php == '8.1' }} 221 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group external-http 222 223 # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist. 224 - name: Run (xDebug) tests 225 if: ${{ ! matrix.split_slow }} 226 continue-on-error: ${{ matrix.php == '8.1' }} 227 run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__ 228 229 - name: Ensure version-controlled files are not modified or deleted 230 run: git diff --exit-code 231 232 - name: Checkout the WordPress Test Reporter 233 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }} 234 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 235 with: 236 repository: 'WordPress/phpunit-test-runner' 237 path: 'test-runner' 238 239 - name: Submit test results to the WordPress.org host test results 240 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }} 241 env: 242 WPT_REPORT_API_KEY: "${{ secrets.WPT_REPORT_API_KEY }}" 243 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 80 with: 81 os: ${{ matrix.os }} 82 php: ${{ matrix.php }} 83 db-type: ${{ matrix.db-type }} 84 db-version: ${{ matrix.db-version }} 85 multisite: ${{ matrix.multisite }} 86 memcached: ${{ matrix.memcached }} 87 phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }} 88 report: ${{ matrix.report || false }} 89 allow-errors: ${{ matrix.allow-errors || false }} 244 90 245 91 slack-notifications: 246 92 name: Slack Notifications 247 93 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 94 95 96 248 97 needs: [ test-php ] 249 98 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} … … 259 108 name: Failed workflow tasks 260 109 runs-on: ubuntu-latest 110 111 261 112 needs: [ test-php, slack-notifications ] 262 113 if: | -
branches/5.9/.github/workflows/test-build-processes.yml
r58357 r58358 1 name: Test npm1 name: Test 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 53 54 55 56 57 58 59 60 61 62 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 - name: Build WordPress in /src 94 run: npm run build:dev 95 96 - name: Clean after building in /src 97 run: npm run grunt clean -- --dev 98 99 - name: Ensure version-controlled files are not modified or deleted during building and cleaning 100 run: git diff --exit-code 101 102 # Verifies that installing npm dependencies and building WordPress works as expected on MacOS. 64 # Tests the WordPress Core build process on MacOS. 103 65 # 104 # 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 to run. 105 67 # This avoids unintentionally consuming excessive minutes, as MacOS jobs consume minutes at a 10x rate. 106 68 # … … 108 70 # currently no way to determine the OS being used on a given job. 109 71 # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. 110 # 111 # Performs the following steps: 112 # - Checks out the repository. 113 # - Logs debug information about the GitHub Action runner. 114 # - Installs Node.js. 115 # _ Installs npm dependencies. 116 # - Builds WordPress to run from the `build` directory. 117 # - Cleans up after building WordPress to the `build` directory. 118 # - Ensures version-controlled files are not modified or deleted. 119 # - Builds WordPress to run from the `src` directory. 120 # - Cleans up after building WordPress to the `src` directory. 121 # - Ensures version-controlled files are not modified or deleted. 122 test-npm-macos: 123 name: Test npm on MacOS 124 runs-on: macos-latest 125 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 126 77 if: ${{ github.repository == 'WordPress/wordpress-develop' }} 127 steps: 128 - name: Checkout repository 129 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 130 131 - name: Log debug information 132 run: | 133 npm --version 134 node --version 135 curl --version 136 git --version 137 svn --version 138 139 - name: Install Node.js 140 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 141 with: 142 node-version-file: '.nvmrc' 143 cache: npm 144 145 - name: Install Dependencies 146 run: npm ci 147 148 - name: Build WordPress 149 run: npm run build 150 151 - name: Clean after building 152 run: npm run grunt clean 153 154 - name: Ensure version-controlled files are not modified or deleted during building and cleaning 155 run: git diff --exit-code 156 157 - name: Build WordPress in /src 158 run: npm run build:dev 159 160 - name: Clean after building in /src 161 run: npm run grunt clean -- --dev 162 163 - name: Ensure version-controlled files are not modified or deleted during building and cleaning 164 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 165 87 166 88 slack-notifications: 167 89 name: Slack Notifications 168 90 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 169 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 ] 170 95 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} 171 96 with: 172 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: ${{ ' }} 173 98 secrets: 174 99 SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} … … 180 105 name: Failed workflow tasks 181 106 runs-on: ubuntu-latest 182 needs: [ test-npm, test-npm-macos, slack-notifications ] 107 permissions: 108 actions: write 109 needs: [ slack-notifications ] 183 110 if: | 184 111 always() && … … 187 114 github.run_attempt < 2 && 188 115 ( 189 needs.test-npm.result == 'cancelled' || needs.test-npm.result == 'failure'||190 needs.test-npm-macos.result == 'cancelled' || needs.test-npm-macos.result == 'failure'116 || 117 191 118 ) 192 119 193 120 steps: 194 121 - name: Dispatch workflow run 195 uses: actions/github-script@ 98814c53be79b1d30f795b907e553d8679345975 # v6.4.0122 uses: actions/github-script@ 196 123 with: 197 124 retries: 2 -
branches/5.9/docker-compose.yml
r53351 r58358 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 41 43 - LOCAL_PHP_MEMCACHED=${LOCAL_PHP_MEMCACHED-false} 42 44 - PHP_FPM_UID=${PHP_FPM_UID-1000} … … 49 51 - ./:/var/www 50 52 51 depends_on: 52 - mysql 53 # Copy or delete the Memcached dropin plugin file as appropriate. 54 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" 55 56 # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly. 57 init: true 58 59 extra_hosts: 60 - localhost:host-gateway 53 61 54 62 ## … … 57 65 mysql: 58 66 image: ${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-latest} 67 59 68 60 69 networks: … … 73 82 # For compatibility with PHP versions that don't support the caching_sha2_password auth plugin used in MySQL 8.0. 74 83 command: --default-authentication-plugin=mysql_native_password 84 85 86 87 88 89 75 90 76 91 ## … … 95 110 init: true 96 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 97 137 volumes: 98 138 # So that sites aren't wiped every time containers are restarted, MySQL uses a persistent volume. -
branches/5.9/tools/local-env/scripts/docker.js
r49362 r58358 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 dockercompose command passed to this script. 8 execSync( 'dockercompose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } ); -
branches/5.9/tools/local-env/scripts/install.js
r51736 r58358 46 46 */ 47 47 function wp_cli( cmd ) { 48 execSync( `docker -compose run --rm cli ${cmd}`, { stdio: 'inherit' } );48 execSync( `dockercompose 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( `dockercompose exec -T php rm -rf ${testPluginDirectory}`, { stdio: 'inherit' } ); 58 execSync( `dockercompose exec -T php git clone https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1`, { stdio: 'inherit' } ); 59 59 } -
branches/5.9/tools/local-env/scripts/start.js
r49362 r58358 6 6 7 7 // Start the local-env containers. 8 execSync( 'docker -compose up -d wordpress-develop', { stdio: 'inherit' } );8 execSync( 'dockercompose up -d wordpress-develop', { stdio: 'inherit' } ); 9 9 10 10 // 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.