Skip to content

Commit ebc6eec

Browse files
committed
Build/Test Tools: Make use of new reusable workflows for 5.7.
This updates the 5.7 branch to utilize the new reusable workflows in trunk introduced in [58165]. This also includes backports for a some additional improvements and bug fixes that are necessary for the local development environment to continue working long term: - The image and platform properties for the mysql container have been updated to always prefer `amd64` containers (#60822). - `macos-13` is now pinned for MacOS jobs instead of `macos-latest` (#61340). - Run E2E tests with and without SCRIPT_DEBUG (#58661). - Migrating to Docker Compose V2 (#60901). - Removing the version property from docker-compose.yml (#59416). - Improvements to how artifacts and comments for Playground testing are generated. - Removing SVN related commands causing failures (#61216). - Updating the `actions/github-scripts` action to the latest version. - Cache the results of `PHP_CodeSniffer` runs (#49783). - A fix to `grunt clean` to prevent `script-loader-packages.php` from being deleted (#53606). Merges [51355], [52179], [56113], [56114], [57918], [58157], [57124], [57125], [57249] to the 5.7 branch. Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin, Clorith, afragen, jrf. See #48783, #61340, #60822, #61216, #60901, #61101, #59416, #59805, #61213, #58661, #53606. git-svn-id: https://develop.svn.wordpress.org/branches/5.7@58598 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c660e17 commit ebc6eec

16 files changed

+228
-614
lines changed

.cache/.gitkeep

Whitespace-only changes.

.github/workflows/coding-standards.yml

Lines changed: 18 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -40,109 +40,35 @@ concurrency:
4040
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
4141
cancel-in-progress: true
4242

43+
# Disable permissions for all available scopes by default.
44+
# Any needed permissions should be configured at the job level.
45+
permissions: {}
46+
4347
jobs:
4448
# Runs PHP coding standards checks.
45-
#
46-
# Violations are reported inline with annotations.
47-
#
48-
# Performs the following steps:
49-
# - Checks out the repository.
50-
# - Sets up PHP.
51-
# - Logs debug information.
52-
# - Installs Composer dependencies (use cache if possible).
53-
# - Make Composer packages available globally.
54-
# - Logs PHP_CodeSniffer debug information.
55-
# - Runs PHPCS on the full codebase with warnings suppressed.
56-
# - Runs PHPCS on the `tests` directory without warnings suppressed.
5749
phpcs:
5850
name: PHP coding standards
59-
runs-on: ubuntu-latest
60-
timeout-minutes: 20
51+
uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@trunk
52+
permissions:
53+
contents: read
6154
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
62-
63-
steps:
64-
- name: Checkout repository
65-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
66-
67-
- name: Set up PHP
68-
uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0
69-
with:
70-
php-version: '7.4'
71-
coverage: none
72-
tools: composer, cs2pr
73-
74-
- name: Log debug information
75-
run: |
76-
php --version
77-
composer --version
78-
79-
- name: Install Composer dependencies
80-
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
81-
with:
82-
composer-options: "--no-progress --no-ansi"
83-
84-
- name: Make Composer packages available globally
85-
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
86-
87-
- name: Log PHPCS debug information
88-
run: phpcs -i
89-
90-
- name: Run PHPCS on all Core files
91-
run: phpcs -q -n --report=checkstyle | cs2pr
92-
93-
- name: Check test suite files for warnings
94-
run: phpcs tests -q --report=checkstyle | cs2pr
55+
with:
56+
php-version: '7.4'
9557

9658
# Runs the JavaScript coding standards checks.
97-
#
98-
# JSHint violations are not currently reported inline with annotations.
99-
#
100-
# Performs the following steps:
101-
# - Checks out the repository.
102-
# - Logs debug information about the GitHub Action runner.
103-
# - Installs Node.js.
104-
# - Logs updated debug information.
105-
# _ Installs npm dependencies.
106-
# - Run the WordPress JSHint checks.
10759
jshint:
10860
name: JavaScript coding standards
109-
runs-on: ubuntu-latest
110-
timeout-minutes: 20
61+
uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk
62+
permissions:
63+
contents: read
11164
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
112-
env:
113-
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
114-
115-
steps:
116-
- name: Checkout repository
117-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
118-
119-
- name: Log debug information
120-
run: |
121-
npm --version
122-
node --version
123-
git --version
124-
svn --version
125-
126-
- name: Install Node.js
127-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
128-
with:
129-
node-version-file: '.nvmrc'
130-
cache: npm
131-
132-
- name: Log debug information
133-
run: |
134-
npm --version
135-
node --version
136-
137-
- name: Install Dependencies
138-
run: npm ci
139-
140-
- name: Run JSHint
141-
run: npm run grunt jshint
14265

14366
slack-notifications:
14467
name: Slack Notifications
14568
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
69+
permissions:
70+
actions: read
71+
contents: read
14672
needs: [ phpcs, jshint ]
14773
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
14874
with:
@@ -156,6 +82,8 @@ jobs:
15682
failed-workflow:
15783
name: Failed workflow tasks
15884
runs-on: ubuntu-latest
85+
permissions:
86+
actions: write
15987
needs: [ phpcs, jshint, slack-notifications ]
16088
if: |
16189
always() &&
@@ -169,7 +97,7 @@ jobs:
16997
17098
steps:
17199
- name: Dispatch workflow run
172-
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
100+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
173101
with:
174102
retries: 2
175103
retry-exempt-status-codes: 418

.github/workflows/javascript-tests.yml

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -38,53 +38,25 @@ concurrency:
3838
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
3939
cancel-in-progress: true
4040

41+
# Disable permissions for all available scopes by default.
42+
# Any needed permissions should be configured at the job level.
43+
permissions: {}
44+
4145
jobs:
4246
# Runs the QUnit tests for WordPress.
43-
#
44-
# Performs the following steps:
45-
# - Checks out the repository.
46-
# - Logs debug information about the GitHub Action runner.
47-
# - Installs Node.js.
48-
# - Logs updated debug information.
49-
# _ Installs npm dependencies.
50-
# - Run the WordPress QUnit tests.
5147
test-js:
5248
name: QUnit Tests
53-
runs-on: ubuntu-latest
54-
timeout-minutes: 20
49+
uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@trunk
50+
permissions:
51+
contents: read
5552
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
5653

57-
steps:
58-
- name: Checkout repository
59-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
60-
61-
- name: Log debug information
62-
run: |
63-
npm --version
64-
node --version
65-
git --version
66-
svn --version
67-
68-
- name: Set up Node.js
69-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
70-
with:
71-
node-version-file: '.nvmrc'
72-
cache: npm
73-
74-
- name: Log debug information
75-
run: |
76-
npm --version
77-
node --version
78-
79-
- name: Install Dependencies
80-
run: npm ci
81-
82-
- name: Run QUnit tests
83-
run: npm run grunt qunit:compiled
84-
8554
slack-notifications:
8655
name: Slack Notifications
8756
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
57+
permissions:
58+
actions: read
59+
contents: read
8860
needs: [ test-js ]
8961
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
9062
with:
@@ -98,6 +70,8 @@ jobs:
9870
failed-workflow:
9971
name: Failed workflow tasks
10072
runs-on: ubuntu-latest
73+
permissions:
74+
actions: write
10175
needs: [ test-js, slack-notifications ]
10276
if: |
10377
always() &&
@@ -110,7 +84,7 @@ jobs:
11084
11185
steps:
11286
- name: Dispatch workflow run
113-
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
87+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
11488
with:
11589
retries: 2
11690
retry-exempt-status-codes: 418

.github/workflows/php-compatibility.yml

Lines changed: 16 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222
- '**.php'
2323
# These files configure Composer. Changes could affect the outcome.
2424
- 'composer.*'
25-
# This file configures PHP Compatibility scanning. Changes could affect the outcome.
25+
# This file configures PHP compatibility scanning. Changes could affect the outcome.
2626
- 'phpcompat.xml.dist'
2727
# Changes to workflow files should always verify all workflows are successful.
2828
- '.github/workflows/*.yml'
@@ -35,59 +35,27 @@ concurrency:
3535
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
3636
cancel-in-progress: true
3737

38-
jobs:
38+
# Disable permissions for all available scopes by default.
39+
# Any needed permissions should be configured at the job level.
40+
permissions: {}
3941

42+
jobs:
4043
# Runs PHP compatibility testing.
41-
#
42-
# Violations are reported inline with annotations.
43-
#
44-
# Performs the following steps:
45-
# - Checks out the repository.
46-
# - Sets up PHP.
47-
# - Logs debug information about the GitHub Action runner.
48-
# - Installs Composer dependencies (use cache if possible).
49-
# - Make Composer packages available globally.
50-
# - Logs PHP_CodeSniffer debug information.
51-
# - Runs the PHP compatibility tests.
5244
php-compatibility:
5345
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
5649
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: composer, cs2pr
68-
69-
- name: Log debug information
70-
run: |
71-
php --version
72-
composer --version
73-
74-
- name: Install Composer dependencies
75-
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
76-
with:
77-
composer-options: "--no-progress --no-ansi"
78-
79-
- name: Make Composer packages available globally
80-
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
81-
82-
- name: Log PHPCS debug information
83-
run: phpcs -i
84-
85-
- name: Run PHP compatibility tests
86-
run: phpcs --standard=phpcompat.xml.dist -q --report=checkstyle | cs2pr
50+
with:
51+
php-version: '7.4'
8752

8853
slack-notifications:
8954
name: Slack Notifications
9055
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
56+
permissions:
57+
actions: read
58+
contents: read
9159
needs: [ php-compatibility ]
9260
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
9361
with:
@@ -101,6 +69,8 @@ jobs:
10169
failed-workflow:
10270
name: Failed workflow tasks
10371
runs-on: ubuntu-latest
72+
permissions:
73+
actions: write
10474
needs: [ php-compatibility, slack-notifications ]
10575
if: |
10676
always() &&
@@ -113,7 +83,7 @@ jobs:
11383
11484
steps:
11585
- name: Dispatch workflow run
116-
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
86+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
11787
with:
11888
retries: 2
11989
retry-exempt-status-codes: 418

0 commit comments

Comments
 (0)