Changeset 58357
- Timestamp:
- 06/06/2024 03:27:31 PM (6 months ago)
- Location:
- branches/6.0
- Files:
-
- 9 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/6.0/.github/workflows/coding-standards.yml
r55490 r58357 10 10 - '[4-9].[0-9]' 11 11 tags: 12 - '3.[89]*' 13 - '[4-9].[0-9]*' 12 - '[0-9]+.[0-9]' 13 - '[0-9]+.[0-9].[0-9]+' 14 - '!3.7.[0-9]+' 14 15 pull_request: 15 16 branches: … … 40 41 cancel-in-progress: true 41 42 43 # Disable permissions for all available scopes by default. 44 # Any needed permissions should be configured at the job level. 45 permissions: {} 46 42 47 jobs: 43 48 # Runs PHP coding standards checks. 44 #45 # Violations are reported inline with annotations.46 #47 # Performs the following steps:48 # - Checks out the repository.49 # - Sets up PHP.50 # - Configures caching for PHPCS scans.51 # - Installs Composer dependencies.52 # - Make Composer packages available globally.53 # - Runs PHPCS on the full codebase with warnings suppressed.54 # - Generate a report for displaying issues as pull request annotations.55 # - Runs PHPCS on the `tests` directory without warnings suppressed.56 # - Generate a report for displaying `test` directory issues as pull request annotations.57 # - Ensures version-controlled files are not modified or deleted.58 49 phpcs: 59 50 name: PHP coding standards 60 runs-on: ubuntu-latest 61 timeout-minutes: 20 51 uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@trunk 52 permissions: 53 contents: read 62 54 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 63 64 steps: 65 - name: Checkout repository 66 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 67 68 - name: Set up PHP 69 uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0 70 with: 71 php-version: '7.4' 72 coverage: none 73 tools: cs2pr 74 75 # This date is used to ensure that the PHPCS cache is cleared at least once every week. 76 # http://man7.org/linux/man-pages/man1/date.1.html 77 - name: "Get last Monday's date" 78 id: get-date 79 run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT 80 81 - name: Cache PHPCS scan cache 82 uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6 83 with: 84 path: | 85 .cache/phpcs-src.json 86 .cache/phpcs-tests.json 87 key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }} 88 89 # Since Composer dependencies are installed using `composer update` and no lock file is in version control, 90 # passing a custom cache suffix ensures that the cache is flushed at least once per week. 91 - name: Install Composer dependencies 92 uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0 93 with: 94 custom-cache-suffix: ${{ steps.get-date.outputs.date }} 95 96 - name: Make Composer packages available globally 97 run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH 98 99 - name: Run PHPCS on all Core files 100 id: phpcs-core 101 run: phpcs -n --report-full --cache=./.cache/phpcs-src.json --report-checkstyle=./.cache/phpcs-report.xml 102 103 - name: Show PHPCS results in PR 104 if: ${{ always() && steps.phpcs-core.outcome == 'failure' }} 105 run: cs2pr ./.cache/phpcs-report.xml 106 107 - name: Check test suite files for warnings 108 id: phpcs-tests 109 run: phpcs tests --report-full --cache=./.cache/phpcs-tests.json --report-checkstyle=./.cache/phpcs-tests-report.xml 110 111 - name: Show test suite scan results in PR 112 if: ${{ always() && steps.phpcs-tests.outcome == 'failure' }} 113 run: cs2pr ./.cache/phpcs-tests-report.xml 114 115 - name: Ensure version-controlled files are not modified during the tests 116 run: git diff --exit-code 55 with: 56 php-version: '7.4' 117 57 118 58 # Runs the JavaScript coding standards checks. 119 #120 # JSHint violations are not currently reported inline with annotations.121 #122 # Performs the following steps:123 # - Checks out the repository.124 # - Sets up Node.js.125 # - Logs debug information about the GitHub Action runner.126 # - Installs npm dependencies.127 # - Run the WordPress JSHint checks.128 # - Ensures version-controlled files are not modified or deleted.129 59 jshint: 130 60 name: JavaScript coding standards 131 runs-on: ubuntu-latest 132 timeout-minutes: 20 61 uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk 62 permissions: 63 contents: read 133 64 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 134 env:135 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}136 137 steps:138 - name: Checkout repository139 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0140 141 - name: Set up Node.js142 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0143 with:144 node-version-file: '.nvmrc'145 cache: npm146 147 - name: Log debug information148 run: |149 npm --version150 node --version151 git --version152 svn --version153 154 - name: Install npm Dependencies155 run: npm ci156 157 - name: Run JSHint158 run: npm run grunt jshint159 160 - name: Ensure version-controlled files are not modified or deleted161 run: git diff --exit-code162 65 163 66 slack-notifications: 164 67 name: Slack Notifications 165 68 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 69 permissions: 70 actions: read 71 contents: read 166 72 needs: [ phpcs, jshint ] 167 73 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} … … 177 83 name: Failed workflow tasks 178 84 runs-on: ubuntu-latest 85 permissions: 86 actions: write 179 87 needs: [ phpcs, jshint, slack-notifications ] 180 88 if: | … … 190 98 steps: 191 99 - name: Dispatch workflow run 192 uses: actions/github-script@ 98814c53be79b1d30f795b907e553d8679345975 # v6.4.0100 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 193 101 with: 194 102 retries: 2 -
branches/6.0/.github/workflows/end-to-end-tests.yml
r57202 r58357 9 9 - '[6-9].[0-9]' 10 10 tags: 11 - '5.[3-9]*' 12 - '[6-9].[0-9]*' 11 - '[0-9]+.[0-9]' 12 - '[0-9]+.[0-9].[0-9]+' 13 - '![34].[0-9].[0-9]+' 14 - '!5.[0-2].[0-9]+' 13 15 pull_request: 14 16 branches: … … 25 27 cancel-in-progress: true 26 28 29 # Disable permissions for all available scopes by default. 30 # Any needed permissions should be configured at the job level. 31 permissions: {} 32 27 33 env: 28 34 LOCAL_DIR: build 29 LOCAL_PHP: 8.0-fpm30 35 31 36 jobs: 32 37 # Runs the end-to-end test suite. 33 #34 # Performs the following steps:35 # - Sets environment variables.36 # - Checks out the repository.37 # - Sets up Node.js.38 # - Logs debug information about the GitHub Action runner.39 # - Installs npm dependencies.40 # - Builds WordPress to run from the `build` directory.41 # - Starts the WordPress Docker container.42 # - Logs the running Docker containers.43 # - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container).44 # - Install WordPress within the Docker container.45 # - Run the E2E tests.46 # - Ensures version-controlled files are not modified or deleted.47 38 e2e-tests: 48 name: E2E Tests 49 runs-on: ubuntu-latest 50 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 51 43 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 52 53 steps: 54 - name: Configure environment variables 55 run: | 56 echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV 57 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV 58 59 - name: Checkout repository 60 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 61 62 - name: Set up Node.js 63 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 64 with: 65 node-version-file: '.nvmrc' 66 cache: npm 67 68 - name: Log debug information 69 run: | 70 npm --version 71 node --version 72 curl --version 73 git --version 74 svn --version 75 locale -a 76 77 - name: Install npm Dependencies 78 run: npm ci 79 80 - name: Build WordPress 81 run: npm run build 82 83 - name: Start Docker environment 84 run: | 85 npm run env:start 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 105 106 - name: Ensure version-controlled files are not modified or deleted 107 run: git diff --exit-code 108 109 slack-notifications: 110 name: Slack Notifications 111 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 112 needs: [ e2e-tests ] 113 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 ] 114 48 with: 115 calling_status: ${{ needs.e2e-tests.result == 'success' && 'success' || needs.e2e-tests.result == 'cancelled' && 'cancelled' || 'failure' }} 116 secrets: 117 SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} 118 SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} 119 SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} 120 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 121 52 122 53 failed-workflow: 123 54 name: Failed workflow tasks 124 55 runs-on: ubuntu-latest 125 needs: [ e2e-tests, slack-notifications ] 56 permissions: 57 actions: write 58 needs: [ e2e-tests ] 126 59 if: | 127 60 always() && … … 132 65 needs.e2e-tests.result == 'cancelled' || needs.e2e-tests.result == 'failure' 133 66 ) 134 135 67 steps: 136 68 - name: Dispatch workflow run 137 uses: actions/github-script@ 98814c53be79b1d30f795b907e553d8679345975 # v6.4.069 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 138 70 with: 139 71 retries: 2 -
branches/6.0/.github/workflows/javascript-tests.yml
r55482 r58357 9 9 - '[4-9].[0-9]' 10 10 tags: 11 - '3.[89]*' 12 - '[4-9].[0-9]*' 11 - '[0-9]+.[0-9]' 12 - '[0-9]+.[0-9].[0-9]+' 13 - '!3.7.[0-9]+' 13 14 pull_request: 14 15 branches: … … 38 39 cancel-in-progress: true 39 40 41 # Disable permissions for all available scopes by default. 42 # Any needed permissions should be configured at the job level. 43 permissions: {} 44 40 45 jobs: 41 46 # Runs the QUnit tests for WordPress. 42 #43 # Performs the following steps:44 # - Checks out the repository.45 # - Sets up Node.js.46 # - Logs debug information about the GitHub Action runner.47 # - Installs npm dependencies.48 # - Run the WordPress QUnit tests.49 # - Ensures version-controlled files are not modified or deleted.50 47 test-js: 51 48 name: QUnit Tests 52 runs-on: ubuntu-latest 53 timeout-minutes: 20 49 uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@trunk 50 permissions: 51 contents: read 54 52 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 55 56 steps:57 - name: Checkout repository58 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.059 60 - name: Set up Node.js61 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.062 with:63 node-version-file: '.nvmrc'64 cache: npm65 66 - name: Log debug information67 run: |68 npm --version69 node --version70 git --version71 svn --version72 73 - name: Install npm Dependencies74 run: npm ci75 76 - name: Run QUnit tests77 run: npm run grunt qunit:compiled78 79 - name: Ensure version-controlled files are not modified or deleted80 run: git diff --exit-code81 53 82 54 slack-notifications: 83 55 name: Slack Notifications 84 56 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 57 permissions: 58 actions: read 59 contents: read 85 60 needs: [ test-js ] 86 61 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} … … 96 71 name: Failed workflow tasks 97 72 runs-on: ubuntu-latest 73 permissions: 74 actions: write 98 75 needs: [ test-js, slack-notifications ] 99 76 if: | … … 108 85 steps: 109 86 - name: Dispatch workflow run 110 uses: actions/github-script@ 98814c53be79b1d30f795b907e553d8679345975 # v6.4.087 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 111 88 with: 112 89 retries: 2 -
branches/6.0/.github/workflows/php-compatibility.yml
r55490 r58357 9 9 - '[6-9].[0-9]' 10 10 tags: 11 - '5.[5-9]*' 12 - '[6-9].[0-9]*' 11 - '[0-9]+.[0-9]' 12 - '[0-9]+.[0-9].[0-9]+' 13 - '![34].[0-9].[0-9]+' 14 - '!5.[0-4].[0-9]+' 13 15 pull_request: 14 16 branches: … … 34 36 cancel-in-progress: true 35 37 38 # Disable permissions for all available scopes by default. 39 # Any needed permissions should be configured at the job level. 40 permissions: {} 41 36 42 jobs: 37 38 43 # Runs PHP compatibility testing. 39 #40 # Violations are reported inline with annotations.41 #42 # Performs the following steps:43 # - Checks out the repository.44 # - Sets up PHP.45 # - Logs debug information.46 # - Configures caching for PHP compatibility scans.47 # - Installs Composer dependencies.48 # - Make Composer packages available globally.49 # - Runs the PHP compatibility tests.50 # - Generate a report for displaying issues as pull request annotations.51 # - Ensures version-controlled files are not modified or deleted.52 44 php-compatibility: 53 45 name: Check PHP compatibility 54 runs-on: ubuntu-latest 55 timeout-minutes: 20 46 uses: WordPress/wordpress-develop/.github/workflows/reusable-php-compatibility.yml@trunk 47 permissions: 48 contents: read 56 49 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 57 58 steps: 59 - name: Checkout repository 60 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 61 62 - name: Set up PHP 63 uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0 64 with: 65 php-version: '7.4' 66 coverage: none 67 tools: cs2pr 68 69 - name: Log debug information 70 run: | 71 composer --version 72 73 # This date is used to ensure that the PHP compatibility cache is cleared at least once every week. 74 # http://man7.org/linux/man-pages/man1/date.1.html 75 - name: "Get last Monday's date" 76 id: get-date 77 run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT 78 79 - name: Cache PHP compatibility scan cache 80 uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6 81 with: 82 path: .cache/phpcompat.json 83 key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }} 84 85 # Since Composer dependencies are installed using `composer update` and no lock file is in version control, 86 # passing a custom cache suffix ensures that the cache is flushed at least once per week. 87 - name: Install Composer dependencies 88 uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0 89 with: 90 custom-cache-suffix: ${{ steps.get-date.outputs.date }} 91 92 - name: Make Composer packages available globally 93 run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH 94 95 - name: Run PHP compatibility tests 96 id: phpcs 97 run: phpcs --standard=phpcompat.xml.dist --report-full --report-checkstyle=./.cache/phpcs-compat-report.xml 98 99 - name: Show PHPCompatibility results in PR 100 if: ${{ always() && steps.phpcs.outcome == 'failure' }} 101 run: cs2pr ./.cache/phpcs-compat-report.xml 102 103 - name: Ensure version-controlled files are not modified or deleted 104 run: git diff --exit-code 50 with: 51 php-version: '7.4' 105 52 106 53 slack-notifications: 107 54 name: Slack Notifications 108 55 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 56 permissions: 57 actions: read 58 contents: read 109 59 needs: [ php-compatibility ] 110 60 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} … … 120 70 name: Failed workflow tasks 121 71 runs-on: ubuntu-latest 72 permissions: 73 actions: write 122 74 needs: [ php-compatibility, slack-notifications ] 123 75 if: | … … 132 84 steps: 133 85 - name: Dispatch workflow run 134 uses: actions/github-script@ 98814c53be79b1d30f795b907e553d8679345975 # v6.4.086 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 135 87 with: 136 88 retries: 2 -
branches/6.0/.github/workflows/phpunit-tests.yml
r55490 r58357 8 8 - '[4-9].[0-9]' 9 9 tags: 10 - ' 3.[7-9]*'11 - '[ 4-9].[0-9]*'10 - '[0-9]+.[0-9]' 11 - '[0-9]+.[0-9].[0-9]+' 12 12 pull_request: 13 13 branches: … … 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 permissions: {} 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 # - Checks out the repository.43 # - Sets up Node.js.44 # - Sets up PHP.45 # - Installs Composer dependencies.46 # - Installs npm dependencies47 # - Logs general debug information about the runner.48 # - Logs Docker debug information (about the Docker installation within the runner).49 # - Starts the WordPress Docker container.50 # - Logs the running Docker containers.51 # - Logs debug information about what's installed within the WordPress Docker containers.52 # - Install WordPress within the Docker container.53 # - Run the PHPUnit tests.54 # - Ensures version-controlled files are not modified or deleted.55 # - Checks out the WordPress Test reporter repository.56 # - Submit the test results to the WordPress.org host test results.57 38 test-php: 58 name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }} 59 runs-on: ${{ matrix.os }} 60 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 61 44 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 62 45 strategy: 63 46 fail-fast: false 64 47 matrix: 48 os: [ ubuntu-latest ] 65 49 php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ] 66 os: [ ubuntu-latest ] 50 db-type: [ 'mysql' ] 51 db-version: [ '5.7' ] 52 multisite: [ false, true ] 67 53 memcached: [ false ] 68 split_slow: [ false ] 69 multisite: [ false, true ] 54 70 55 include: 71 # Additional "slow" jobs for PHP 5.6. 72 - php: '5.6' 73 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 74 78 memcached: false 75 multisite: false76 split_slow: true77 - php: '5.6'78 os: ubuntu-latest79 memcached: false80 multisite: true81 split_slow: true82 # Include jobs for PHP 7.4 with memcached.83 - php: '7.4'84 os: ubuntu-latest85 memcached: true86 multisite: false87 - php: '7.4'88 os: ubuntu-latest89 memcached: true90 multisite: true91 # Report the results of the PHP 7.4 without memcached job.92 - php: '7.4'93 os: ubuntu-latest94 memcached: false95 multisite: false96 79 report: true 97 98 env: 99 LOCAL_PHP: ${{ matrix.php }}-fpm 100 LOCAL_PHP_MEMCACHED: ${{ matrix.memcached }} 101 PHPUNIT_CONFIG: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }} 102 103 steps: 104 - name: Configure environment variables 105 run: | 106 echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV 107 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV 108 109 - name: Checkout repository 110 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 111 112 - name: Set up Node.js 113 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 114 with: 115 node-version-file: '.nvmrc' 116 cache: npm 117 118 ## 119 # This allows Composer dependencies to be installed using a single step. 120 # 121 # Since the tests are currently run within the Docker containers where the PHP version varies, 122 # the same PHP version needs to be configured for the action runner machine so that the correct 123 # dependency versions are installed and cached. 124 ## 125 - name: Set up PHP 126 uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0 127 with: 128 php-version: '${{ matrix.php }}' 129 coverage: none 130 131 # Since Composer dependencies are installed using `composer update` and no lock file is in version control, 132 # passing a custom cache suffix ensures that the cache is flushed at least once per week. 133 - name: Install Composer dependencies 134 uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0 135 with: 136 custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F") 137 138 - name: Install npm dependencies 139 run: npm ci 140 141 - name: General debug information 142 run: | 143 npm --version 144 node --version 145 curl --version 146 git --version 147 svn --version 148 composer --version 149 locale -a 150 151 - name: Docker debug information 152 run: | 153 docker -v 154 docker-compose -v 155 156 - name: Start Docker environment 157 run: | 158 npm run env:start 159 160 - name: Log running Docker containers 161 run: docker ps -a 162 163 - name: WordPress Docker container debug information 164 run: | 165 docker-compose run --rm mysql mysql --version 166 docker-compose run --rm php php --version 167 docker-compose run --rm php php -m 168 docker-compose run --rm php php -i 169 docker-compose run --rm php locale -a 170 171 - name: Install WordPress 172 run: npm run env:install 173 174 - name: Run slow PHPUnit tests 175 if: ${{ matrix.split_slow }} 176 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }} 177 178 - name: Run PHPUnit tests for single site excluding slow tests 179 if: ${{ matrix.php < '7.0' && ! matrix.split_slow && ! matrix.multisite }} 180 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 181 182 - name: Run PHPUnit tests for Multisite excluding slow tests 183 if: ${{ matrix.php < '7.0' && ! matrix.split_slow && matrix.multisite }} 184 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 185 186 - name: Run PHPUnit tests 187 if: ${{ matrix.php >= '7.0' }} 188 continue-on-error: ${{ matrix.php == '8.1' }} 189 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} 190 191 - name: Run AJAX tests 192 if: ${{ ! matrix.split_slow }} 193 continue-on-error: ${{ matrix.php == '8.1' }} 194 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax 195 196 - name: Run ms-files tests as a multisite install 197 if: ${{ matrix.multisite && ! matrix.split_slow }} 198 continue-on-error: ${{ matrix.php == '8.1' }} 199 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml --group ms-files 200 201 - name: Run external HTTP tests 202 if: ${{ ! matrix.multisite && ! matrix.split_slow }} 203 continue-on-error: ${{ matrix.php == '8.1' }} 204 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group external-http 205 206 # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist. 207 - name: Run (xDebug) tests 208 if: ${{ ! matrix.split_slow }} 209 continue-on-error: ${{ matrix.php == '8.1' }} 210 run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__ 211 212 - name: Ensure version-controlled files are not modified or deleted 213 run: git diff --exit-code 214 215 - name: Checkout the WordPress Test Reporter 216 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }} 217 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 218 with: 219 repository: 'WordPress/phpunit-test-runner' 220 path: 'test-runner' 221 222 - name: Submit test results to the WordPress.org host test results 223 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && matrix.report }} 224 env: 225 WPT_REPORT_API_KEY: "${{ secrets.WPT_REPORT_API_KEY }}" 226 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 }} 227 90 228 91 slack-notifications: 229 92 name: Slack Notifications 230 93 uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk 94 permissions: 95 actions: read 96 contents: read 231 97 needs: [ test-php ] 232 98 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} … … 242 108 name: Failed workflow tasks 243 109 runs-on: ubuntu-latest 110 permissions: 111 actions: write 244 112 needs: [ test-php, slack-notifications ] 245 113 if: | … … 254 122 steps: 255 123 - name: Dispatch workflow run 256 uses: actions/github-script@ 98814c53be79b1d30f795b907e553d8679345975 # v6.4.0124 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 257 125 with: 258 126 retries: 2 -
branches/6.0/.github/workflows/test-build-processes.yml
r58356 r58357 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 # - Sets up Node.js. 45 # - Logs debug information about the GitHub Action runner. 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: Set up Node.js 68 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 69 with: 70 node-version-file: '.nvmrc' 71 cache: npm 72 73 - name: Log debug information 74 run: | 75 npm --version 76 node --version 77 curl --version 78 git --version 79 svn --version 80 81 - name: Install npm Dependencies 82 run: npm ci 83 84 - name: Build WordPress in /src 85 run: npm run build:dev 86 87 - name: Clean after building in /src 88 run: npm run grunt clean -- --dev 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 94 run: npm run build 95 96 - name: Clean after building 97 run: npm run grunt clean 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 determining 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 # - Sets up Node.js. 114 # - Logs debug information about the GitHub Action runner. 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: Set up Node.js 132 uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 133 with: 134 node-version-file: '.nvmrc' 135 cache: npm 136 137 - name: Log debug information 138 run: | 139 npm --version 140 node --version 141 curl --version 142 git --version 143 svn --version 144 145 - name: Install npm Dependencies 146 run: npm ci 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 156 157 - name: Build WordPress 158 run: npm run build 159 160 - name: Clean after building 161 run: npm run grunt clean 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: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} 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 contains( needs.*.result, 'cancelled' ) || 117 contains( needs.*.result, 'failure' ) 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@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 196 123 with: 197 124 retries: 2 -
branches/6.0/docker-compose.yml
r55482 r58357 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} … … 52 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" 53 55 54 depends_on:55 - mysql56 57 56 # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly. 58 57 init: true … … 65 64 ## 66 65 mysql: 67 image: amd64/${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-latest} 66 image: ${LOCAL_DB_TYPE-mysql}:${LOCAL_DB_VERSION-latest} 67 platform: linux/amd64 68 68 69 69 networks: … … 82 82 # For compatibility with PHP versions that don't support the caching_sha2_password auth plugin used in MySQL 8.0. 83 83 command: --default-authentication-plugin=mysql_native_password 84 85 healthcheck: 86 test: [ "CMD-SHELL", "if [ \"$LOCAL_DB_TYPE\" = \"mariadb\" ]; then mariadb-admin ping -h localhost; else mysqladmin ping -h localhost; fi" ] 87 timeout: 5s 88 interval: 5s 89 retries: 10 84 90 85 91 ## … … 107 113 - localhost:host-gateway 108 114 115 depends_on: 116 php: 117 condition: service_started 118 mysql: 119 condition: service_healthy 120 109 121 ## 110 122 # The Memcached container. … … 119 131 - 11211:11211 120 132 133 depends_on: 134 php: 135 condition: service_started 136 121 137 volumes: 122 138 # So that sites aren't wiped every time containers are restarted, MySQL uses a persistent volume. -
branches/6.0/tools/local-env/scripts/docker.js
r55482 r58357 5 5 dotenvExpand.expand( 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/6.0/tools/local-env/scripts/install.js
r55482 r58357 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/6.0/tools/local-env/scripts/start.js
r55482 r58357 9 9 ? 'wordpress-develop memcached' 10 10 : 'wordpress-develop'; 11 execSync( `docker -compose up -d -- ${containers}`, { stdio: 'inherit' } );11 execSync( `docker compose up -d -- ${containers}`, { stdio: 'inherit' } ); 12 12 13 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.