Changeset 59679
- Timestamp:
- 01/22/2025 03:13:21 PM (5 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/coding-standards.yml
r59673 r59679 108 108 ref: 'trunk', 109 109 inputs: { 110 run_id: '${{ github.run_id }}'110 run_id: context.runId, 111 111 } 112 112 }); -
trunk/.github/workflows/end-to-end-tests.yml
r59673 r59679 94 94 ref: 'trunk', 95 95 inputs: { 96 run_id: '${{ github.run_id }}'96 run_id: context.runId, 97 97 } 98 98 }); -
trunk/.github/workflows/failed-workflow.yml
r57197 r59679 39 39 owner: context.repo.owner, 40 40 repo: context.repo.repo, 41 run_id: ${{ inputs.run_id }},41 run_id: process.env.RUN_ID, 42 42 }); 43 43 … … 50 50 owner: context.repo.owner, 51 51 repo: context.repo.repo, 52 run_id: ${{ inputs.run_id }},52 run_id: process.env.RUN_ID, 53 53 enable_debug_logging: true 54 54 }); 55 env: 56 RUN_ID: ${{ inputs.run_id }} -
trunk/.github/workflows/install-testing.yml
r59673 r59679 120 120 php-version: '${{ matrix.php }}' 121 121 coverage: none 122 tools: wp-cli${{ contains( fromJSON('["5.4", "5.5"]'), matrix.php ) && ':2.4.0' || '' }}122 tools: ${{ contains( fromJSON('["5.4", "5.5"]'), matrix.php ) && 'wp-cli:2.4.0' || 'wp-cli' }} 123 123 124 124 - name: Download WordPress 125 run: wp core download ${{ inputs.wp-version && format( '--version={0}', inputs.wp-version ) || '--version=nightly' }} 125 run: wp core download --version="${WP_VERSION}" 126 env: 127 WP_VERSION: ${{ inputs.wp-version || 'nightly' }} 126 128 127 129 - name: Create wp-config.php file 128 run: wp config create --dbname=test_db --dbuser=root --dbpass=root --dbhost=127.0.0.1:${{ job.services.database.ports['3306'] }} 130 run: wp config create --dbname=test_db --dbuser=root --dbpass=root --dbhost="127.0.0.1:${DB_PORT}" 131 env: 132 DB_PORT: ${{ job.services.database.ports['3306'] }} 129 133 130 134 - name: Install WordPress 131 run: wp core ${{ matrix.multisite && 'multisite- ' || '' }}install--url=http://localhost/ --title="Upgrade Test" --admin_user=admin --admin_password=password --admin_email=me@example.org --skip-email135 run: wp core ${{ matrix.multisite && 'multisite-install' || 'install' }} --url=http://localhost/ --title="Upgrade Test" --admin_user=admin --admin_password=password --admin_email=me@example.org --skip-email 132 136 133 137 slack-notifications: … … 176 180 ref: 'trunk', 177 181 inputs: { 178 run_id: '${{ github.run_id }}'182 run_id: context.runId, 179 183 } 180 184 }); -
trunk/.github/workflows/javascript-tests.yml
r59673 r59679 98 98 ref: 'trunk', 99 99 inputs: { 100 run_id: '${{ github.run_id }}'100 run_id: context.runId, 101 101 } 102 102 }); -
trunk/.github/workflows/local-docker-environment.yml
r59673 r59679 105 105 db-version: ${{ matrix.db-version }} 106 106 memcached: ${{ matrix.memcached }} 107 tests-domain: ${{ matrix.tests-domain }}108 107 109 108 slack-notifications: … … 152 151 ref: 'trunk', 153 152 inputs: { 154 run_id: '${{ github.run_id }}'153 run_id: context.runId, 155 154 } 156 155 }); -
trunk/.github/workflows/performance.yml
r59673 r59679 94 94 ref: 'trunk', 95 95 inputs: { 96 run_id: '${{ github.run_id }}'96 run_id: context.runId, 97 97 } 98 98 }); -
trunk/.github/workflows/php-compatibility.yml
r59673 r59679 95 95 ref: 'trunk', 96 96 inputs: { 97 run_id: '${{ github.run_id }}'97 run_id: context.runId, 98 98 } 99 99 }); -
trunk/.github/workflows/phpunit-tests.yml
r59673 r59679 145 145 memcached: ${{ matrix.memcached }} 146 146 phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }} 147 report: ${{ matrix.report ||false }}147 report: ${{ false }} 148 148 149 149 # … … 194 194 memcached: ${{ matrix.memcached }} 195 195 phpunit-config: ${{ matrix.multisite && 'tests/phpunit/multisite.xml' || 'phpunit.xml.dist' }} 196 report: ${{ matrix.report ||false }}196 report: ${{ false }} 197 197 198 198 # … … 264 264 ref: 'trunk', 265 265 inputs: { 266 run_id: '${{ github.run_id }}'266 run_id: context.runId, 267 267 } 268 268 }); -
trunk/.github/workflows/props-bot.yml
r58903 r59679 86 86 owner: context.repo.owner, 87 87 repo: context.repo.repo, 88 issue_number: '${{ github.event.number }}',88 issue_number: process.env.ISSUE_NUMBER, 89 89 name: 'props-bot' 90 90 }); 91 env: 92 ISSUE_NUMBER: ${{ github.event.number }} -
trunk/.github/workflows/pull-request-comments.yml
r59441 r59679 97 97 owner: context.repo.owner, 98 98 repo: context.repo.repo, 99 run_id: ${{ github.event.workflow_run.id }},99 run_id: process.env.RUN_ID, 100 100 } ); 101 101 … … 118 118 const fs = require( 'fs' ); 119 119 fs.writeFileSync( '${{github.workspace}}/pr-number.zip', Buffer.from( download.data ) ) 120 env: 121 RUN_ID: ${{ github.event.workflow_run.id }} 120 122 121 123 - name: Unzip the artifact containing the PR number -
trunk/.github/workflows/reusable-cleanup-pull-requests.yml
r59661 r59679 30 30 - name: Find fixed ticket numbers 31 31 id: trac-tickets 32 env: 33 COMMIT_MSG_RAW: ${{ github.event.head_commit.message }} 32 34 run: | 33 COMMIT_MESSAGE=$(cat <<'EOF' | sed -n '/^Fixes #/,/\./p' 34 ${{ github.event.head_commit.message }} 35 EOF 36 ) 37 echo "fixed_list=$(echo \"$COMMIT_MESSAGE\" | sed -n 's/.*Fixes #\([0-9]\+\).*/\1/p' | tr '\n' ' ')" >> $GITHUB_OUTPUT 35 COMMIT_MESSAGE="$(echo "$COMMIT_MSG_RAW" | sed -n '/^Fixes #/,/\./p')" 36 echo "fixed_list=$(echo "$COMMIT_MESSAGE" | sed -n 's/.*Fixes #\([0-9]\+\).*/\1/p' | tr '\n' ' ')" >> "$GITHUB_OUTPUT" 38 37 39 38 - name: Get the SVN revision 40 39 id: git-svn-id 40 env: 41 COMMIT_MSG_RAW: ${{ github.event.head_commit.message }} 41 42 run: | 42 COMMIT_MESSAGE=$(cat <<'EOF' | sed -n '$p' 43 ${{ github.event.head_commit.message }} 44 EOF 45 ) 46 echo "svn_revision_number=$(echo \"$COMMIT_MESSAGE\" | sed -n 's/.*git-svn-id: https:\/\/develop.svn.wordpress.org\/[^@]*@\([0-9]*\) .*/\1/p')" >> $GITHUB_OUTPUT 43 COMMIT_MESSAGE="$(echo "$COMMIT_MSG_RAW" | sed -n '$p')" 44 echo "svn_revision_number=$(echo "$COMMIT_MESSAGE" | sed -n 's/.*git-svn-id: https:\/\/develop.svn.wordpress.org\/[^@]*@\([0-9]*\) .*/\1/p')" >> "$GITHUB_OUTPUT" 47 45 48 46 - name: Find pull requests -
trunk/.github/workflows/reusable-coding-standards-javascript.yml
r59354 r59679 9 9 env: 10 10 PUPPETEER_SKIP_DOWNLOAD: ${{ true }} 11 12 # Disable permissions for all available scopes by default. 13 # Any needed permissions should be configured at the job level. 14 permissions: {} 11 15 12 16 jobs: … … 34 38 with: 35 39 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 40 persist-credentials: false 36 41 37 42 - name: Set up Node.js -
trunk/.github/workflows/reusable-coding-standards-php.yml
r59354 r59679 17 17 type: 'boolean' 18 18 default: false 19 20 # Disable permissions for all available scopes by default. 21 # Any needed permissions should be configured at the job level. 22 permissions: {} 19 23 20 24 jobs: … … 46 50 with: 47 51 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 52 persist-credentials: false 48 53 49 54 - name: Set up PHP … … 58 63 - name: "Get last Monday's date" 59 64 id: get-date 60 run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT65 run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT" 61 66 62 67 - name: Cache PHPCS scan cache … … 76 81 77 82 - name: Make Composer packages available globally 78 run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH83 run: echo "${PWD}/vendor/bin" >> "$GITHUB_PATH" 79 84 80 85 - name: Run PHPCS on all Core files -
trunk/.github/workflows/reusable-end-to-end-tests.yml
r59354 r59679 34 34 LOCAL_PHP: ${{ inputs.php-version }}${{ 'latest' != inputs.php-version && '-fpm' || '' }} 35 35 36 # Disable permissions for all available scopes by default. 37 # Any needed permissions should be configured at the job level. 38 permissions: {} 39 36 40 jobs: 37 41 # Runs the end-to-end test suite. … … 64 68 - name: Configure environment variables 65 69 run: | 66 echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV67 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV70 echo "PHP_FPM_UID=$(id -u)" >> "$GITHUB_ENV" 71 echo "PHP_FPM_GID=$(id -g)" >> "$GITHUB_ENV" 68 72 69 73 - name: Checkout repository … … 71 75 with: 72 76 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 77 persist-credentials: false 73 78 74 79 - name: Set up Node.js … … 118 123 - name: Install Gutenberg 119 124 if: ${{ inputs.install-gutenberg }} 120 run: npm run env:cli -- plugin install gutenberg${{ inputs.gutenberg-version && format( ' --version={0}', inputs.gutenberg-version ) || '' }} --path=/var/www/${{ env.LOCAL_DIR }} 125 run: | 126 npm run env:cli -- plugin install gutenberg \ 127 ${{ inputs.gutenberg-version && '--version="${GUTENBERG_VERSION}"' || '' }} \ 128 --path="/var/www/${LOCAL_DIR}" 129 env: 130 GUTENBERG_VERSION: ${{ inputs.gutenberg-version }} 121 131 122 132 - name: Install additional languages 123 133 run: | 124 npm run env:cli -- language core install de_DE --path= /var/www/${{ env.LOCAL_DIR }}125 npm run env:cli -- language plugin install de_DE --all --path= /var/www/${{ env.LOCAL_DIR }}126 npm run env:cli -- language theme install de_DE --all --path= /var/www/${{ env.LOCAL_DIR }}134 npm run env:cli -- language core install de_DE --path="/var/www/${LOCAL_DIR}" 135 npm run env:cli -- language plugin install de_DE --all --path="/var/www/${LOCAL_DIR}" 136 npm run env:cli -- language theme install de_DE --all --path="/var/www/${LOCAL_DIR}" 127 137 128 138 - name: Run E2E tests -
trunk/.github/workflows/reusable-javascript-tests.yml
r59635 r59679 12 12 type: 'boolean' 13 13 default: false 14 15 # Disable permissions for all available scopes by default. 16 # Any needed permissions should be configured at the job level. 17 permissions: {} 14 18 15 19 jobs: … … 35 39 with: 36 40 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 41 persist-credentials: false 37 42 38 43 - name: Set up Node.js -
trunk/.github/workflows/reusable-performance.yml
r59669 r59679 64 64 LOCAL_PHP: ${{ inputs.php-version }}${{ 'latest' != inputs.php-version && '-fpm' || '' }} 65 65 LOCAL_MULTISITE: ${{ inputs.multisite }} 66 67 # Disable permissions for all available scopes by default. 68 # Any needed permissions should be configured at the job level. 69 permissions: {} 66 70 67 71 jobs: … … 120 124 - name: Configure environment variables 121 125 run: | 122 echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV123 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV126 echo "PHP_FPM_UID=$(id -u)" >> "$GITHUB_ENV" 127 echo "PHP_FPM_GID=$(id -g)" >> "$GITHUB_ENV" 124 128 125 129 - name: Checkout repository … … 128 132 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 129 133 fetch-depth: ${{ github.event_name == 'workflow_dispatch' && '2' || '1' }} 134 persist-credentials: false 130 135 131 136 # The `workflow_dispatch` event is the only one missing the needed SHA to target. 132 137 - name: Retrieve previous commit SHA (if necessary) 133 138 if: ${{ github.event_name == 'workflow_dispatch' }} 134 run: echo "TARGET_SHA=$(git rev-parse HEAD^1)" >> $GITHUB_ENV139 run: echo "TARGET_SHA=$(git rev-parse HEAD^1)" >> "$GITHUB_ENV" 135 140 136 141 - name: Set up Node.js … … 182 187 if: ${{ inputs.multisite }} 183 188 run: | 184 npm run env:cli -- theme enable twentytwentyone --network --path= /var/www/${{ env.LOCAL_DIR }}185 npm run env:cli -- theme enable twentytwentythree --network --path= /var/www/${{ env.LOCAL_DIR }}186 npm run env:cli -- theme enable twentytwentyfour --network --path= /var/www/${{ env.LOCAL_DIR }}187 npm run env:cli -- theme enable twentytwentyfive --network --path= /var/www/${{ env.LOCAL_DIR }}189 npm run env:cli -- theme enable twentytwentyone --network --path="/var/www/${LOCAL_DIR}" 190 npm run env:cli -- theme enable twentytwentythree --network --path="/var/www/${LOCAL_DIR}" 191 npm run env:cli -- theme enable twentytwentyfour --network --path="/var/www/${LOCAL_DIR}" 192 npm run env:cli -- theme enable twentytwentyfive --network --path="/var/www/${LOCAL_DIR}" 188 193 189 194 - name: Install WordPress Importer plugin 190 run: npm run env:cli -- plugin install wordpress-importer --activate --path= /var/www/${{ env.LOCAL_DIR }}195 run: npm run env:cli -- plugin install wordpress-importer --activate --path="/var/www/${LOCAL_DIR}" 191 196 192 197 - name: Import mock data 193 198 run: | 194 199 curl -O https://raw.githubusercontent.com/WordPress/theme-test-data/b9752e0533a5acbb876951a8cbb5bcc69a56474c/themeunittestdata.wordpress.xml 195 npm run env:cli -- import themeunittestdata.wordpress.xml --authors=create --path= /var/www/${{ env.LOCAL_DIR }}200 npm run env:cli -- import themeunittestdata.wordpress.xml --authors=create --path="/var/www/${LOCAL_DIR}" 196 201 rm themeunittestdata.wordpress.xml 197 202 198 203 - name: Deactivate WordPress Importer plugin 199 run: npm run env:cli -- plugin deactivate wordpress-importer --path= /var/www/${{ env.LOCAL_DIR }}204 run: npm run env:cli -- plugin deactivate wordpress-importer --path="/var/www/${LOCAL_DIR}" 200 205 201 206 - name: Update permalink structure 202 run: npm run env:cli -- rewrite structure '/%year%/%monthnum%/%postname%/' --path= /var/www/${{ env.LOCAL_DIR }}207 run: npm run env:cli -- rewrite structure '/%year%/%monthnum%/%postname%/' --path="/var/www/${LOCAL_DIR}" 203 208 204 209 - name: Install additional languages 205 210 run: | 206 npm run env:cli -- language core install de_DE --path= /var/www/${{ env.LOCAL_DIR }}207 npm run env:cli -- language plugin install de_DE --all --path= /var/www/${{ env.LOCAL_DIR }}208 npm run env:cli -- language theme install de_DE --all --path= /var/www/${{ env.LOCAL_DIR }}211 npm run env:cli -- language core install de_DE --path="/var/www/${LOCAL_DIR}" 212 npm run env:cli -- language plugin install de_DE --all --path="/var/www/${LOCAL_DIR}" 213 npm run env:cli -- language theme install de_DE --all --path="/var/www/${LOCAL_DIR}" 209 214 210 215 # Prevent background update checks from impacting test stability. 211 216 - name: Disable external HTTP requests 212 run: npm run env:cli -- config set WP_HTTP_BLOCK_EXTERNAL true --raw --type=constant --path= /var/www/${{ env.LOCAL_DIR }}217 run: npm run env:cli -- config set WP_HTTP_BLOCK_EXTERNAL true --raw --type=constant --path="/var/www/${LOCAL_DIR}" 213 218 214 219 # Prevent background tasks from impacting test stability. 215 220 - name: Disable cron 216 run: npm run env:cli -- config set DISABLE_WP_CRON true --raw --type=constant --path= /var/www/${{ env.LOCAL_DIR }}221 run: npm run env:cli -- config set DISABLE_WP_CRON true --raw --type=constant --path="/var/www/${LOCAL_DIR}" 217 222 218 223 - name: List defined constants 219 run: npm run env:cli -- config list --path= /var/www/${{ env.LOCAL_DIR }}224 run: npm run env:cli -- config list --path="/var/www/${LOCAL_DIR}" 220 225 221 226 - name: Install MU plugin 222 227 run: | 223 mkdir ./${{ env.LOCAL_DIR }}/wp-content/mu-plugins224 cp ./tests/performance/wp-content/mu-plugins/server-timing.php ./${{ env.LOCAL_DIR }}/wp-content/mu-plugins/server-timing.php228 mkdir "./${LOCAL_DIR}/wp-content/mu-plugins" 229 cp ./tests/performance/wp-content/mu-plugins/server-timing.php "./${LOCAL_DIR}/wp-content/mu-plugins/server-timing.php" 225 230 226 231 - name: Run performance tests (current commit) … … 253 258 254 259 const fs = require( 'fs' ); 255 fs.writeFileSync( '${{ github.workspace }}/before.zip', Buffer.from( download.data ) )260 fs.writeFileSync( process.env.GITHUB_WORKSPACE + '/before.zip', Buffer.from( download.data ) ) 256 261 257 262 return true; … … 260 265 if: ${{ steps.get-previous-build.outputs.result }} 261 266 run: | 262 unzip ${{ github.workspace }}/before.zip263 unzip -o ${{ github.workspace }}/wordpress.zip267 unzip "${GITHUB_WORKSPACE}/before.zip" 268 unzip -o "${GITHUB_WORKSPACE}/wordpress.zip" 264 269 265 270 - name: Run any database upgrades 266 271 if: ${{ steps.get-previous-build.outputs.result }} 267 run: npm run env:cli -- core update-db --path= /var/www/${{ env.LOCAL_DIR }}272 run: npm run env:cli -- core update-db --path="/var/www/${LOCAL_DIR}" 268 273 269 274 - name: Flush cache 270 275 if: ${{ steps.get-previous-build.outputs.result }} 271 run: npm run env:cli -- cache flush --path= /var/www/${{ env.LOCAL_DIR }}276 run: npm run env:cli -- cache flush --path="/var/www/${LOCAL_DIR}" 272 277 273 278 - name: Delete expired transients 274 279 if: ${{ steps.get-previous-build.outputs.result }} 275 run: npm run env:cli -- transient delete --expired --path= /var/www/${{ env.LOCAL_DIR }}280 run: npm run env:cli -- transient delete --expired --path="/var/www/${LOCAL_DIR}" 276 281 277 282 - name: Run target performance tests (previous/target commit) … … 284 289 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' }} 285 290 run: | 286 VERSION="${ { env.BASE_TAG }}"291 VERSION="${BASE_TAG}" 287 292 VERSION="${VERSION%.0}" 288 npm run env:cli -- core update --version= $VERSION --force --path=/var/www/${{ env.LOCAL_DIR }}289 npm run env:cli -- core version --path= /var/www/${{ env.LOCAL_DIR }}293 npm run env:cli -- core update --version="$VERSION" --force --path="/var/www/${LOCAL_DIR}" 294 npm run env:cli -- core version --path="/var/www/${LOCAL_DIR}" 290 295 291 296 - name: Run any database upgrades 292 297 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' }} 293 run: npm run env:cli -- core update-db --path= /var/www/${{ env.LOCAL_DIR }}298 run: npm run env:cli -- core update-db --path="/var/www/${LOCAL_DIR}" 294 299 295 300 - name: Flush cache 296 301 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' }} 297 run: npm run env:cli -- cache flush --path= /var/www/${{ env.LOCAL_DIR }}302 run: npm run env:cli -- cache flush --path="/var/www/${LOCAL_DIR}" 298 303 299 304 - name: Delete expired transients 300 305 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' }} 301 run: npm run env:cli -- transient delete --expired --path= /var/www/${{ env.LOCAL_DIR }}306 run: npm run env:cli -- transient delete --expired --path="/var/www/${LOCAL_DIR}" 302 307 303 308 - name: Run baseline performance tests … … 317 322 318 323 - name: Compare results 319 run: node ./tests/performance/compare-results.js ${{ runner.temp }}/summary.md324 run: node ./tests/performance/compare-results.js "${RUNNER_TEMP}/summary.md" 320 325 321 326 - name: Add workflow summary 322 run: cat ${{ runner.temp }}/summary.md >> $GITHUB_STEP_SUMMARY327 run: cat "${RUNNER_TEMP}/summary.md" >> "$GITHUB_STEP_SUMMARY" 323 328 324 329 - name: Set the base sha … … 330 335 github-token: ${{ secrets.GITHUB_TOKEN }} 331 336 script: | 332 const baseRef = await github.rest.git.getRef({ owner: context.repo.owner, repo: context.repo.repo, ref: 'tags/${{ env.BASE_TAG }}' }); 337 const baseRef = await github.rest.git.getRef({ 338 owner: context.repo.owner, 339 repo: context.repo.repo, 340 ref: 'tags/' + process.env.BASE_TAG, 341 }); 333 342 return baseRef.data.object.sha; 334 335 - name: Set commit details336 # Only needed when publishing results.337 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }}338 # Write to an environment variable to have the output available in later steps of the job.339 run: echo "COMMITTED_AT=$(git show -s $GITHUB_SHA --format='%cI')" >> $GITHUB_ENV340 343 341 344 - name: Publish performance results … … 348 351 run: | 349 352 if [ -z "$CODEVITALS_PROJECT_TOKEN" ]; then 350 echo "Performance results could not be published. 'CODEVITALS_PROJECT_TOKEN' is not set" >> $GITHUB_OUTPUT353 echo "Performance results could not be published. 'CODEVITALS_PROJECT_TOKEN' is not set" 351 354 exit 1 352 355 fi 353 node ./tests/performance/log-results.js $CODEVITALS_PROJECT_TOKEN trunk $GITHUB_SHA $BASE_SHA $COMMITTED_AT $HOST_NAME 356 COMMITTED_AT="$(git show -s "$GITHUB_SHA" --format='%cI')" 357 node ./tests/performance/log-results.js "$CODEVITALS_PROJECT_TOKEN" trunk "$GITHUB_SHA" "$BASE_SHA" "$COMMITTED_AT" "$HOST_NAME" 354 358 355 359 - name: Ensure version-controlled files are not modified or deleted -
trunk/.github/workflows/reusable-php-compatibility.yml
r59354 r59679 12 12 type: 'string' 13 13 default: 'latest' 14 15 # Disable permissions for all available scopes by default. 16 # Any needed permissions should be configured at the job level. 17 permissions: {} 14 18 15 19 jobs: … … 40 44 with: 41 45 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 46 persist-credentials: false 42 47 43 48 - name: Set up PHP … … 56 61 - name: "Get last Monday's date" 57 62 id: get-date 58 run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT63 run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT" 59 64 60 65 - name: Cache PHP compatibility scan cache … … 72 77 73 78 - name: Make Composer packages available globally 74 run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH79 run: echo "${PWD}/vendor/bin" >> "$GITHUB_PATH" 75 80 76 81 - name: Run PHP compatibility tests -
trunk/.github/workflows/reusable-phpunit-tests-v1.yml
r59534 r59679 51 51 default: false 52 52 env: 53 COMPOSER_INSTALL: ${{ false }} 53 54 LOCAL_PHP: ${{ inputs.php }}-fpm 54 55 LOCAL_PHPUNIT: ${{ inputs.phpunit && inputs.phpunit || inputs.php }}-fpm … … 58 59 PUPPETEER_SKIP_DOWNLOAD: ${{ true }} 59 60 SLOW_TESTS: 'external-http,media' 61 62 # Disable permissions for all available scopes by default. 63 # Any needed permissions should be configured at the job level. 64 permissions: {} 60 65 61 66 jobs: … … 87 92 - name: Configure environment variables 88 93 run: | 89 echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV90 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV94 echo "PHP_FPM_UID=$(id -u)" >> "$GITHUB_ENV" 95 echo "PHP_FPM_GID=$(id -g)" >> "$GITHUB_ENV" 91 96 92 97 - name: Checkout repository … … 94 99 with: 95 100 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 101 persist-credentials: false 96 102 97 103 - name: Set up Node.js … … 106 112 - name: Build WordPress 107 113 run: npm run build 114 115 - name: Get composer cache directory 116 if: ${{ env.COMPOSER_INSTALL == true }} 117 id: composer-cache 118 run: echo "composer_dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" 108 119 109 120 - name: Cache Composer dependencies … … 136 147 run: | 137 148 cp tests/phpunit/includes/object-cache.php build/wp-content/object-cache.php 138 docker run --name memcached --net $(basename "$PWD")_wpdevnet -d memcached 149 BASE=$(basename "$PWD") 150 docker run --name memcached --net "${BASE}_wpdevnet" -d memcached 139 151 140 152 - name: General debug information … … 161 173 - name: Run slow PHPUnit tests 162 174 if: ${{ inputs.split_slow }} 163 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }}175 run: npm run "test:${PHPUNIT_SCRIPT}" -- --verbose -c "${PHPUNIT_CONFIG}" --group "${SLOW_TESTS}" 164 176 165 177 - name: Run PHPUnit tests for single site excluding slow tests 166 178 if: ${{ inputs.php < '7.0' && ! inputs.split_slow && ! inputs.multisite }} 167 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-required179 run: npm run "test:${PHPUNIT_SCRIPT}" -- --verbose -c "${PHPUNIT_CONFIG}" --exclude-group "${SLOW_TESTS},ajax,ms-files,ms-required" 168 180 169 181 - name: Run PHPUnit tests for Multisite excluding slow tests 170 182 if: ${{ inputs.php < '7.0' && ! inputs.split_slow && inputs.multisite }} 171 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-excluded,oembed-headers183 run: npm run "test:${PHPUNIT_SCRIPT}" -- --verbose -c "${PHPUNIT_CONFIG}" --exclude-group "${SLOW_TESTS},ajax,ms-files,ms-excluded,oembed-headers" 172 184 173 185 - name: Run PHPUnit tests 174 186 if: ${{ inputs.php >= '7.0' }} 175 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }}187 run: npm run "test:${PHPUNIT_SCRIPT}" -- --verbose -c "${PHPUNIT_CONFIG}" 176 188 177 189 - name: Run AJAX tests 178 190 if: ${{ ! inputs.multisite && ! inputs.split_slow }} 179 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }}--group ajax191 run: npm run "test:${PHPUNIT_SCRIPT}" -- --verbose -c "${PHPUNIT_CONFIG}" --group ajax 180 192 181 193 - name: Run external HTTP tests 182 194 if: ${{ ! inputs.multisite && ! inputs.split_slow }} 183 run: npm run test:${{ env.PHPUNIT_SCRIPT }}-- --verbose -c phpunit.xml.dist --group external-http195 run: npm run "test:${PHPUNIT_SCRIPT}" -- --verbose -c phpunit.xml.dist --group external-http -
trunk/.github/workflows/reusable-phpunit-tests-v2.yml
r59354 r59679 63 63 PHPUNIT_SCRIPT: php 64 64 SLOW_TESTS: 'external-http,media' 65 66 # Disable permissions for all available scopes by default. 67 # Any needed permissions should be configured at the job level. 68 permissions: {} 65 69 66 70 jobs: … … 90 94 - name: Configure environment variables 91 95 run: | 92 echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV93 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV96 echo "PHP_FPM_UID=$(id -u)" >> "$GITHUB_ENV" 97 echo "PHP_FPM_GID=$(id -g)" >> "$GITHUB_ENV" 94 98 95 99 - name: Checkout repository … … 97 101 with: 98 102 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 103 persist-credentials: false 99 104 100 105 - name: Install Node.js … … 109 114 - name: Get composer cache directory 110 115 id: composer-cache 111 run: echo "composer_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT116 run: echo "composer_dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" 112 117 113 118 - name: Cache Composer dependencies … … 126 131 # as PHPUnit 7 is no longer supported. The Composer-installed PHPUnit should be 127 132 # used for PHP 8 testing instead. 128 if [ ${{ env.LOCAL_PHP }}== '8.0-fpm' ]; then133 if [ "${LOCAL_PHP}" == '8.0-fpm' ]; then 129 134 docker compose run --rm php composer install --ignore-platform-reqs 130 echo "PHPUNIT_SCRIPT=php-composer" >> $GITHUB_ENV131 elif [ ${{ env.LOCAL_PHP }}== '7.1-fpm' ]; then135 echo "PHPUNIT_SCRIPT=php-composer" >> "$GITHUB_ENV" 136 elif [ "${LOCAL_PHP}" == '7.1-fpm' ]; then 132 137 docker compose run --rm php composer update 133 138 git checkout -- composer.lock 134 elif [[ ${{ env.LOCAL_PHP }} == '5.6-fpm' || ${{ env.LOCAL_PHP }}== '7.0-fpm' ]]; then139 elif [[ "${LOCAL_PHP}" == '5.6-fpm' || "${LOCAL_PHP}" == '7.0-fpm' ]]; then 135 140 docker compose run --rm php composer require --dev phpunit/phpunit:"^5.7" --update-with-dependencies 136 141 git checkout -- composer.lock composer.json … … 171 176 - name: Run slow PHPUnit tests 172 177 if: ${{ inputs.split_slow }} 173 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }}178 run: npm run "test:${PHPUNIT_SCRIPT}" -- --verbose -c "${PHPUNIT_CONFIG}" --group "${SLOW_TESTS}" 174 179 175 180 - name: Run PHPUnit tests for single site excluding slow tests 176 181 if: ${{ inputs.php < '7.0' && ! inputs.split_slow && ! inputs.multisite }} 177 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-required182 run: npm run "test:${PHPUNIT_SCRIPT}" -- --verbose -c "${PHPUNIT_CONFIG}" --exclude-group "${SLOW_TESTS},ajax,ms-files,ms-required" 178 183 179 184 - name: Run PHPUnit tests for Multisite excluding slow tests 180 185 if: ${{ inputs.php < '7.0' && ! inputs.split_slow && inputs.multisite }} 181 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-excluded,oembed-headers186 run: npm run "test:${PHPUNIT_SCRIPT}" -- --verbose -c "${PHPUNIT_CONFIG}" --exclude-group "${SLOW_TESTS},ajax,ms-files,ms-excluded,oembed-headers" 182 187 183 188 - name: Run PHPUnit tests 184 189 if: ${{ inputs.php >= '7.0' }} 185 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }}190 run: npm run "test:${PHPUNIT_SCRIPT}" -- --verbose -c "${PHPUNIT_CONFIG}" 186 191 187 192 - name: Run AJAX tests 188 193 if: ${{ ! inputs.split_slow&& inputs.test_ajax }} 189 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }}--group ajax194 run: npm run "test:${PHPUNIT_SCRIPT}" -- --verbose -c "${PHPUNIT_CONFIG}" --group ajax 190 195 191 196 - name: Run ms-files tests as a multisite install 192 197 if: ${{ inputs.multisite && ! inputs.split_slow }} 193 run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c ${{ env.PHPUNIT_CONFIG }}--group ms-files198 run: npm run "test:${PHPUNIT_SCRIPT}" -- --verbose -c "${PHPUNIT_CONFIG}" --group ms-files 194 199 195 200 - name: Run external HTTP tests 196 201 if: ${{ ! inputs.multisite && ! inputs.split_slow }} 197 run: npm run test:${{ env.PHPUNIT_SCRIPT }}-- --verbose -c phpunit.xml.dist --group external-http202 run: npm run "test:${PHPUNIT_SCRIPT}" -- --verbose -c phpunit.xml.dist --group external-http 198 203 199 204 # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist. 200 205 - name: Run (xDebug) tests 201 206 if: ${{ ! inputs.split_slow }} 202 run: LOCAL_PHP_XDEBUG=true npm run test:${{ env.PHPUNIT_SCRIPT }}-- -v --group xdebug --exclude-group __fakegroup__207 run: LOCAL_PHP_XDEBUG=true npm run "test:${PHPUNIT_SCRIPT}" -- -v --group xdebug --exclude-group __fakegroup__ 203 208 204 209 - name: Ensure version-controlled files are not modified or deleted -
trunk/.github/workflows/reusable-phpunit-tests-v3.yml
r59586 r59679 77 77 description: 'The Codecov token required for uploading reports.' 78 78 required: false 79 WPT_REPORT_API_KEY: 80 description: 'The WordPress.org Hosting Tests API key.' 81 required: false 82 79 83 env: 80 84 LOCAL_PHP: ${{ inputs.php }}-fpm … … 87 91 PHPUNIT_CONFIG: ${{ inputs.phpunit-config }} 88 92 PUPPETEER_SKIP_DOWNLOAD: ${{ true }} 93 94 # Disable permissions for all available scopes by default. 95 # Any needed permissions should be configured at the job level. 96 permissions: {} 89 97 90 98 jobs: … … 118 126 - name: Configure environment variables 119 127 run: | 120 echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV121 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV128 echo "PHP_FPM_UID=$(id -u)" >> "$GITHUB_ENV" 129 echo "PHP_FPM_GID=$(id -g)" >> "$GITHUB_ENV" 122 130 123 131 - name: Checkout repository … … 125 133 with: 126 134 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 135 persist-credentials: false 127 136 128 137 - name: Set up Node.js … … 177 186 - name: WordPress Docker container debug information 178 187 run: | 179 docker compose run --rm mysql ${{ env.LOCAL_DB_TYPE == 'mariadb' && contains( fromJSON('["5.5", "10.0", "10.1", "10.2", "10.3"]'), env.LOCAL_DB_VERSION ) && 'mysql' || env.LOCAL_DB_TYPE }}--version188 docker compose run --rm mysql "${LOCAL_DB_CMD}" --version 180 189 docker compose run --rm php php --version 181 190 docker compose run --rm php php -m 182 191 docker compose run --rm php php -i 183 192 docker compose run --rm php locale -a 193 env: 194 LOCAL_DB_CMD: ${{ env.LOCAL_DB_TYPE == 'mariadb' && contains( fromJSON('["5.5", "10.0", "10.1", "10.2", "10.3"]'), env.LOCAL_DB_VERSION ) && 'mysql' || env.LOCAL_DB_TYPE }} 184 195 185 196 - name: Install WordPress … … 188 199 - name: Run PHPUnit tests${{ inputs.phpunit-test-groups && format( ' ({0} groups)', inputs.phpunit-test-groups ) || '' }}${{ inputs.coverage-report && ' with coverage report' || '' }} 189 200 continue-on-error: ${{ inputs.allow-errors }} 190 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}${{ inputs.phpunit-test-groups && format( ' --group {0}', inputs.phpunit-test-groups ) || '' }}${{ inputs.coverage-report && format( ' --coverage-clover wp-code-coverage-{0}-{1}.xml --coverage-html wp-code-coverage-{0}-{1}', ( inputs.multisite && 'multisite' || 'single' ), github.sha ) || '' }} 201 run: | 202 node ./tools/local-env/scripts/docker.js run \ 203 php ./vendor/bin/phpunit \ 204 --verbose \ 205 -c "${PHPUNIT_CONFIG}" \ 206 ${{ inputs.phpunit-test-groups && '--group "${TEST_GROUPS}"' || '' }} \ 207 ${{ inputs.coverage-report && '--coverage-clover "wp-code-coverage-${MULTISITE_FLAG}-${GITHUB_SHA}.xml" --coverage-html "wp-code-coverage-${MULTISITE_FLAG}-${GITHUB_SHA}"' || '' }} 208 env: 209 TEST_GROUPS: ${{ inputs.phpunit-test-groups }} 210 MULTISITE_FLAG: ${{ inputs.multisite && 'multisite' || 'single' }} 191 211 192 212 - name: Run AJAX tests 193 213 if: ${{ ! inputs.phpunit-test-groups && ! inputs.coverage-report }} 194 214 continue-on-error: ${{ inputs.allow-errors }} 195 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}--group ajax215 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ajax 196 216 197 217 - name: Run ms-files tests as a multisite install 198 218 if: ${{ inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }} 199 219 continue-on-error: ${{ inputs.allow-errors }} 200 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}--group ms-files220 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group ms-files 201 221 202 222 - name: Run external HTTP tests 203 223 if: ${{ ! inputs.multisite && ! inputs.phpunit-test-groups && ! inputs.coverage-report }} 204 224 continue-on-error: ${{ inputs.allow-errors }} 205 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}--group external-http225 run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c "${PHPUNIT_CONFIG}" --group external-http 206 226 207 227 # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist. … … 238 258 path: 'test-runner' 239 259 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 260 persist-credentials: false 240 261 241 262 - name: Submit test results to the WordPress.org host test results -
trunk/.github/workflows/reusable-support-json-reader-v1.yml
r59507 r59679 27 27 value: ${{ jobs.mysql-versions.outputs.versions }} 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 jobs: 30 34 # Determines the major version of WordPress being tested. … … 37 41 major-wp-version: 38 42 name: Determine major WordPress version 43 permissions: 44 contents: read 39 45 runs-on: ubuntu-latest 40 46 timeout-minutes: 5 … … 48 54 repository: ${{ inputs.repository }} 49 55 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 56 persist-credentials: false 50 57 51 58 - name: Determine the major WordPress version 52 59 id: major-wp-version 53 60 run: | 54 if [ "${ { inputs.wp-version }}" ] && [ "${{ inputs.wp-version }}" != "nightly" ] && [ "${{ inputs.wp-version }}" != "latest" ] && [ "${{ inputs.wp-version }}" != "trunk" ]; then55 echo "version=$(echo "${ { inputs.wp-version }}" | tr '.' '-' | cut -d '-' -f1-2)" >> $GITHUB_OUTPUT56 elif [ "${ { inputs.wp-version }}" ] && [ "${{ inputs.wp-version }}" != "trunk" ]; then57 echo "version=$ (echo "${{ inputs.wp-version }}")" >> $GITHUB_OUTPUT61 if [ "${WP_VERSION}" ] && [ "${WP_VERSION}" != "nightly" ] && [ "${WP_VERSION}" != "latest" ] && [ "${WP_VERSION}" != "trunk" ]; then 62 echo "version=$(echo "${WP_VERSION}" | tr '.' '-' | cut -d '-' -f1-2)" >> "$GITHUB_OUTPUT" 63 elif [ "${WP_VERSION}" ] && [ "${WP_VERSION}" != "trunk" ]; then 64 echo "version=${WP_VERSION}" >> "$GITHUB_OUTPUT" 58 65 else 59 echo "version=nightly" >> $GITHUB_OUTPUT66 echo "version=nightly" >> "$GITHUB_OUTPUT" 60 67 fi 68 env: 69 WP_VERSION: ${{ inputs.wp-version }} 61 70 62 71 # Determines the versions of PHP supported for a version of WordPress. … … 68 77 php-versions: 69 78 name: Determine PHP versions 79 permissions: 80 contents: read 70 81 runs-on: ubuntu-latest 71 82 needs: [ major-wp-version ] … … 80 91 repository: ${{ inputs.repository }} 81 92 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 93 persist-credentials: false 82 94 83 95 # Look up the major version's specific PHP support policy when a version is provided. … … 86 98 id: php-versions 87 99 run: | 88 if [ "${{ needs.major-wp-version.outputs.version }}" != "latest" ] && [ "${{ needs.major-wp-version.outputs.version }}" != "nightly" ]; then 89 echo "versions=$(jq -r '.["${{ needs.major-wp-version.outputs.version }}"] | @json' .version-support-php.json)" >> $GITHUB_OUTPUT 100 if [ "${WP_VERSION}" != "latest" ] && [ "${WP_VERSION}" != "nightly" ]; then 101 VERSIONS="$( jq \ 102 -r \ 103 --arg wp_version "${WP_VERSION}" \ 104 '.[$wp_version] | @json' \ 105 .version-support-php.json 106 )" 107 echo "versions=$VERSIONS" >> "$GITHUB_OUTPUT" 90 108 else 91 echo "versions=$(jq -r '.[ (keys[-1]) ] | @json' .version-support-php.json)" >> $GITHUB_OUTPUT109 echo "versions=$(jq -r '.[ (keys[-1]) ] | @json' .version-support-php.json)" >> "$GITHUB_OUTPUT" 92 110 fi 111 env: 112 WP_VERSION: ${{ needs.major-wp-version.outputs.version }} 93 113 94 114 # Determines the versions of MySQL supported for a version of WordPress. … … 100 120 mysql-versions: 101 121 name: Determine MySQL versions 122 permissions: 123 contents: read 102 124 runs-on: ubuntu-latest 103 125 needs: [ major-wp-version ] … … 112 134 repository: ${{ inputs.repository }} 113 135 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 136 persist-credentials: false 114 137 115 138 # Look up the major version's specific MySQL support policy when a version is provided. … … 118 141 id: mysql-versions 119 142 run: | 120 if [ "${{ needs.major-wp-version.outputs.version }}" != "latest" ] && [ "${{ needs.major-wp-version.outputs.version }}" != "nightly" ]; then 121 echo "versions=$(jq -r '.["${{ needs.major-wp-version.outputs.version }}"] | @json' .version-support-mysql.json)" >> $GITHUB_OUTPUT 143 if [ "${WP_VERSION}" != "latest" ] && [ "${WP_VERSION}" != "nightly" ]; then 144 VERSIONS="$( jq \ 145 -r \ 146 --arg wp_version "${WP_VERSION}" \ 147 '.[$wp_version] | @json' \ 148 .version-support-mysql.json 149 )" 150 echo "versions=$VERSIONS" >> "$GITHUB_OUTPUT" 122 151 else 123 echo "versions=$(jq -r '.[ (keys[-1]) ] | @json' .version-support-mysql.json)" >> $GITHUB_OUTPUT152 echo "versions=$(jq -r '.[ (keys[-1]) ] | @json' .version-support-mysql.json)" >> "$GITHUB_OUTPUT" 124 153 fi 154 env: 155 WP_VERSION: ${{ needs.major-wp-version.outputs.version }} -
trunk/.github/workflows/reusable-test-core-build-process.yml
r59354 r59679 36 36 PUPPETEER_SKIP_DOWNLOAD: ${{ 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 43 # Verifies that installing npm dependencies and building WordPress works as expected. … … 54 58 build-process-tests: 55 59 name: Core running from ${{ inputs.directory }} / ${{ contains( inputs.os, 'macos-' ) && 'MacOS' || contains( inputs.os, 'windows-' ) && 'Windows' || 'Linux' }} 60 permissions: 61 contents: read 56 62 runs-on: ${{ inputs.os }} 57 63 timeout-minutes: 20 … … 62 68 with: 63 69 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 70 persist-credentials: false 64 71 65 72 - name: Set up Node.js … … 86 93 87 94 - name: Build WordPress to run from ${{ inputs.directory }} 88 run: npm run build${{ inputs.directory == 'src' && ':dev' || '' }}95 run: npm run ${{ inputs.directory == 'src' && 'build:dev' || 'build' }} 89 96 90 97 - name: Ensure version-controlled files are not modified or deleted during building … … 96 103 97 104 - name: Clean after building to run from ${{ inputs.directory }} 98 run: npm run grunt clean${{ inputs.directory == 'src' && ' -- --dev' || '' }}105 run: npm run grunt ${{ inputs.directory == 'src' && 'clean -- --dev' || 'clean' }} 99 106 100 107 - name: Ensure version-controlled files are not modified or deleted during cleaning … … 113 120 run: | 114 121 mkdir -p ./pr-number 115 echo ${{ github.event.number }} > ./pr-number/NR 122 echo "${EVENT_NUMBER}" > ./pr-number/NR 123 env: 124 EVENT_NUMBER: ${{ github.event.number }} 116 125 117 126 # Uploads the PR number as an artifact for the Pull Request Commenting workflow to download and then -
trunk/.github/workflows/reusable-test-gutenberg-build-process.yml
r59354 r59679 23 23 NODE_OPTIONS: '--max-old-space-size=8192' 24 24 25 # Disable permissions for all available scopes by default. 26 # Any needed permissions should be configured at the job level. 27 permissions: {} 28 25 29 jobs: 26 30 # Verifies that installing npm dependencies and building the Gutenberg plugin works as expected. … … 39 43 build-process-tests: 40 44 name: Gutenberg running from ${{ inputs.directory }} / ${{ contains( inputs.os, 'macos-' ) && 'MacOS' || contains( inputs.os, 'windows-' ) && 'Windows' || 'Linux' }} 45 permissions: 46 contents: read 41 47 runs-on: ${{ inputs.os }} 42 48 timeout-minutes: 30 … … 47 53 with: 48 54 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 55 persist-credentials: false 49 56 50 57 - name: Checkout Gutenberg plugin … … 54 61 path: ${{ env.GUTENBERG_DIRECTORY }} 55 62 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 63 persist-credentials: false 56 64 57 65 - name: Set up Node.js … … 83 91 84 92 - name: Build WordPress to run from ${{ inputs.directory }} 85 run: npm run build${{ inputs.directory == 'src' && ':dev' || '' }}93 run: npm run ${{ inputs.directory == 'src' && 'build:dev' || 'build' }} 86 94 87 95 - name: Run Gutenberg build script after building Core to run from ${{ inputs.directory }} -
trunk/.github/workflows/reusable-test-local-docker-environment-v1.yml
r59527 r59679 48 48 PUPPETEER_SKIP_DOWNLOAD: ${{ true }} 49 49 50 # Disable permissions for all available scopes by default. 51 # Any needed permissions should be configured at the job level. 52 permissions: {} 53 50 54 jobs: 51 55 # Tests the local Docker environment. … … 71 75 local-docker-environment-tests: 72 76 name: PHP ${{ inputs.php }} / ${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.memcached && ' with memcached' || '' }}${{ 'example.org' != inputs.tests-domain && format( ' {0}', inputs.tests-domain ) || '' }} 77 permissions: 78 contents: read 73 79 runs-on: ${{ inputs.os }} 74 80 timeout-minutes: 20 … … 77 83 - name: Configure environment variables 78 84 run: | 79 echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV80 echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV85 echo "PHP_FPM_UID=$(id -u)" >> "$GITHUB_ENV" 86 echo "PHP_FPM_GID=$(id -g)" >> "$GITHUB_ENV" 81 87 82 88 - name: Checkout repository … … 84 90 with: 85 91 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 92 persist-credentials: false 86 93 87 94 - name: Set up Node.js … … 136 143 - name: WordPress Docker container debug information 137 144 run: | 138 docker compose run --rm mysql ${{ env.LOCAL_DB_TYPE }}--version145 docker compose run --rm mysql "${LOCAL_DB_TYPE}" --version 139 146 docker compose run --rm php php --version 140 147 docker compose run --rm php php -m -
trunk/.github/workflows/reusable-upgrade-testing.yml
r59402 r59679 38 38 default: '5.7' 39 39 40 # Disable permissions for all available scopes by default. 41 # Any needed permissions should be configured at the job level. 42 permissions: {} 43 40 44 jobs: 41 45 # Runs upgrade tests on a build of WordPress. … … 50 54 upgrade-tests: 51 55 name: ${{ inputs.wp }} to ${{ inputs.new-version }} / PHP ${{ inputs.php }} with ${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.multisite && ' multisite' || '' }} 56 permissions: {} 52 57 runs-on: ${{ inputs.os }} 53 58 timeout-minutes: 20 … … 77 82 78 83 - name: Download WordPress ${{ inputs.wp }} 79 run: wp core download --version=${{ inputs.wp }} 84 run: wp core download --version="${WP_VERSION}" 85 env: 86 WP_VERSION: ${{ inputs.wp }} 80 87 81 88 - name: Create wp-config.php file 82 run: wp config create --dbname=test_db --dbuser=root --dbpass=root --dbhost=127.0.0.1:${{ job.services.database.ports['3306'] }} 89 run: wp config create --dbname=test_db --dbuser=root --dbpass=root --dbhost="127.0.0.1:${DB_PORT}" 90 env: 91 DB_PORT: ${{ job.services.database.ports['3306'] }} 83 92 84 93 - name: Install WordPress 85 run: wp core ${{ inputs.multisite && 'multisite-' || '' }}install --url=http://localhost/ --title="Upgrade Test" --admin_user=admin --admin_password=password --admin_email=me@example.org --skip-email 94 run: | 95 wp core ${{ inputs.multisite && 'multisite-install' || 'install' }} \ 96 --url=http://localhost/ --title="Upgrade Test" --admin_user=admin \ 97 --admin_password=password --admin_email=me@example.org --skip-email 86 98 87 99 - name: Update to the latest minor version … … 90 102 - name: Upgrade to WordPress ${{ inputs.new-version }} 91 103 run: | 92 wp core update${{ 'latest' != inputs.new-version && format( ' --version={0}', inputs.new-version ) || '' }} 104 wp core update ${{ 'latest' != inputs.new-version && '--version="${WP_VERSION}"' || '' }} 105 env: 106 WP_VERSION: ${{ inputs.new-version }} -
trunk/.github/workflows/slack-notifications.yml
r59519 r59679 55 55 if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event.workflow_run.event != 'pull_request' }} 56 56 outputs: 57 previous_conclusion: ${{ steps.previous- conclusion.outputs.previous_conclusion}}57 previous_conclusion: ${{ steps.previous-attempt-result.outputs.result }} 58 58 payload: ${{ steps.create-payload.outputs.payload }} 59 59 … … 69 69 owner: context.repo.owner, 70 70 repo: context.repo.repo, 71 run_id: ${{ github.run_id }},71 run_id: context.runId, 72 72 }); 73 73 74 if ( '${{ inputs.calling_status }}'== 'failure' && workflow_run.data.run_attempt == 1 ) {74 if ( process.env.CALLING_STATUS == 'failure' && workflow_run.data.run_attempt == 1 ) { 75 75 return 'first-failure'; 76 76 } … … 83 83 owner: context.repo.owner, 84 84 repo: context.repo.repo, 85 run_id: ${{ github.run_id }},85 run_id: context.runId, 86 86 attempt_number: workflow_run.data.run_attempt - 1 87 87 }); … … 95 95 repo: context.repo.repo, 96 96 workflow_id: workflow_run.data.workflow_id, 97 branch: '${{ env.CURRENT_BRANCH }}',97 branch: process.env.CURRENT_BRANCH, 98 98 exclude_pull_requests: true, 99 99 }); … … 125 125 // Can't determine previous workflow conclusion. 126 126 return 'unknown'; 127 128 - name: Store previous conclusion as an output 129 id: previous-conclusion 130 run: echo "previous_conclusion=${{ steps.previous-attempt-result.outputs.result }}" >> $GITHUB_OUTPUT 127 env: 128 CALLING_STATUS: ${{ inputs.calling_status }} 131 129 132 130 - name: Get the commit message … … 141 139 owner: context.repo.owner, 142 140 repo: context.repo.repo, 143 ref: '${{ github.sha }}'141 ref: context.sha, 144 142 }); 145 143 return commit_details.data.commit.message; … … 148 146 id: commit-message 149 147 run: | 150 COMMIT_MESSAGE=$(cat <<'EOF' | awk 'NR==1' | sed 's/`/\\`/g' | sed 's/\"/\\\\\\"/g' | sed 's/\$/\\$/g'151 ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) && fromJson( steps.current-commit-message.outputs.result ) || github.event.head_commit.message }}152 EOF153 )154 echo "commit_message_escaped=${COMMIT_MESSAGE}" >> $GITHUB_OUTPUT148 # shellcheck disable=SC2016 149 COMMIT_MESSAGE="$(echo "${COMMIT_MSG_RAW}" | awk 'NR==1' | sed 's/`/\\`/g' | sed 's/\"/\\\\\\"/g' | sed 's/\$/\\$/g')" 150 echo "commit_message_escaped=${COMMIT_MESSAGE}" >> "$GITHUB_OUTPUT" 151 env: 152 COMMIT_MSG_RAW: ${{ ( github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' ) && fromJson( steps.current-commit-message.outputs.result ) || github.event.head_commit.message }} 155 153 156 154 - name: Construct payload and store as an output 157 155 id: create-payload 158 run: echo "payload={\"workflow_name\":\"${{ github.workflow }}\",\"ref_name\":\"${{ env.CURRENT_BRANCH }}\",\"run_url\":\"https://github.com/WordPress/wordpress-develop/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}\",\"commit_message\":\"${{ steps.commit-message.outputs.commit_message_escaped }}\"}" >> $GITHUB_OUTPUT 156 run: | 157 PAYLOAD="$( jq \ 158 -n \ 159 --arg workflow_name "${GITHUB_WORKFLOW}" \ 160 --arg ref_name "${CURRENT_BRANCH}" \ 161 --arg run_url "https://github.com/WordPress/wordpress-develop/actions/runs/${GITHUB_RUN_ID}/attempts/${GITHUB_RUN_ATTEMPT}" \ 162 --arg commit_message "${COMMIT_MSG}" \ 163 '{workflow_name: $workflow_name, ref_name: $ref_name, run_url: $run_url, commit_message: $commit_message}' 164 )" 165 echo "payload=$PAYLOAD" >> "$GITHUB_OUTPUT" 166 env: 167 COMMIT_MSG: ${{ steps.commit-message.outputs.commit_message_escaped }} 159 168 160 169 # Posts notifications when a workflow fails. 161 170 failure: 162 171 name: Failure notifications 172 permissions: {} 163 173 runs-on: ubuntu-latest 164 174 timeout-minutes: 10 … … 177 187 fixed: 178 188 name: Fixed notifications 189 permissions: {} 179 190 runs-on: ubuntu-latest 180 191 timeout-minutes: 10 … … 193 204 success: 194 205 name: Success notifications 206 permissions: {} 195 207 runs-on: ubuntu-latest 196 208 timeout-minutes: 10 … … 209 221 cancelled: 210 222 name: Cancelled notifications 223 permissions: {} 211 224 runs-on: ubuntu-latest 212 225 timeout-minutes: 10 -
trunk/.github/workflows/test-and-zip-default-themes.yml
r59673 r59679 92 92 ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }} 93 93 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 94 persist-credentials: false 94 95 95 96 - name: Check for zero-byte (empty) files 96 97 run: | 97 [[ ! $(find src/wp-content/themes/${{ matrix.theme }} -empty) ]] 98 [[ ! $(find "src/wp-content/themes/${THEME}" -empty) ]] 99 env: 100 THEME: ${{ matrix.theme }} 98 101 99 102 # Tests the build script for themes that have one. … … 131 134 ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }} 132 135 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 136 persist-credentials: false 133 137 134 138 - name: Set up Node.js … … 188 192 ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }} 189 193 show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} 194 persist-credentials: false 190 195 191 196 - name: Upload theme ZIP as an artifact -
trunk/.github/workflows/upgrade-testing.yml
r59673 r59679 60 60 uses: ./.github/workflows/reusable-upgrade-testing.yml 61 61 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 62 permissions:63 contents: read64 62 strategy: 65 63 fail-fast: false … … 97 95 uses: ./.github/workflows/reusable-upgrade-testing.yml 98 96 if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} 99 permissions:100 contents: read101 97 strategy: 102 98 fail-fast: false … … 112 108 # The PHP <= 7.3/MySQL 8.4 jobs currently fail due to mysql_native_password being disabled by default. See https://core.trac.wordpress.org/ticket/61218. 113 109 - php: '7.2' 114 db-version: '8.4'115 - php: '7.3'116 110 db-version: '8.4' 117 111 with: … … 142 136 # The PHP <= 7.3/MySQL 8.4 jobs currently fail due to mysql_native_password being disabled by default. See https://core.trac.wordpress.org/ticket/61218. 143 137 - php: '7.2' 144 db-version: '8.4'145 - php: '7.3'146 138 db-version: '8.4' 147 139 with: … … 201 193 # The PHP <= 7.3/MySQL 8.4 jobs currently fail due to mysql_native_password being disabled by default. See https://core.trac.wordpress.org/ticket/61218. 202 194 - php: '7.2' 203 db-version: '8.4'204 - php: '7.3'205 195 db-version: '8.4' 206 196 with: -
trunk/docker-compose.yml
r59668 r59679 39 39 40 40 environment: 41 - LOCAL_PHP_XDEBUG=${LOCAL_PHP_XDEBUG-false}42 - XDEBUG_MODE=${LOCAL_PHP_XDEBUG_MODE-develop,debug}43 - LOCAL_PHP_MEMCACHED=${LOCAL_PHP_MEMCACHED-false}44 - PHP_FPM_UID=${PHP_FPM_UID-1000}45 - PHP_FPM_GID=${PHP_FPM_GID-1000}46 - GITHUB_REF=${GITHUB_REF-false}47 - GITHUB_EVENT_NAME=${GITHUB_EVENT_NAME-false}48 - HOST_PATH=${PWD-}/${LOCAL_DIR-src}41 LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false} 42 XDEBUG_MODE: ${LOCAL_PHP_XDEBUG_MODE-develop,debug} 43 LOCAL_PHP_MEMCACHED: ${LOCAL_PHP_MEMCACHED-false} 44 PHP_FPM_UID: ${PHP_FPM_UID-1000} 45 PHP_FPM_GID: ${PHP_FPM_GID-1000} 46 GITHUB_REF: ${GITHUB_REF-false} 47 GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME-false} 48 HOST_PATH: ${PWD-}/${LOCAL_DIR-src} 49 49 50 50 volumes: … … 84 84 85 85 healthcheck: 86 test: [ "CMD-SHELL", "if [ \"$LOCAL_DB_TYPE\" = \"mariadb\" ]; then case \"$LOCAL_DB_VERSION\" in 5.5|10.0|10.1|10.2|10.3) mysqladmin ping -h localhost || exit $$?;; *) mariadb-admin ping -h localhost || exit $$?;; esac; else mysqladmin ping -h localhost || exit $$?; fi" ] 86 test: [ 87 'CMD-SHELL', 88 'if [ "$LOCAL_DB_TYPE" = "mariadb" ]; then case "$LOCAL_DB_VERSION" in 5.5|10.0|10.1|10.2|10.3) mysqladmin ping -h localhost || exit $$?;; *) mariadb-admin ping -h localhost || exit $$?;; esac; else mysqladmin ping -h localhost || exit $$?; fi' 89 ] 87 90 timeout: 5s 88 91 interval: 5s … … 99 102 100 103 environment: 101 - LOCAL_PHP_XDEBUG=${LOCAL_PHP_XDEBUG-false}102 - LOCAL_PHP_MEMCACHED=${LOCAL_PHP_MEMCACHED-false}103 - PHP_FPM_UID=${PHP_FPM_UID-1000}104 - PHP_FPM_GID=${PHP_FPM_GID-1000}105 - HOST_PATH=${PWD-}/${LOCAL_DIR-src}104 LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false} 105 LOCAL_PHP_MEMCACHED: ${LOCAL_PHP_MEMCACHED-false} 106 PHP_FPM_UID: ${PHP_FPM_UID-1000} 107 PHP_FPM_GID: ${PHP_FPM_GID-1000} 108 HOST_PATH: ${PWD-}/${LOCAL_DIR-src} 106 109 107 110 volumes:
Note: See TracChangeset
for help on using the changeset viewer.