Skip to content

Commit 978aae7

Browse files
committed
Build/Test Tools: Make use of new reusable workflows for 5.1.
This updates the 5.1 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). - 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). - Move the Memcached container into the Docker Compose config (#55700). - Improvements to the `healthcheck` command for the `mysql` container (#58867). - Skip some tests when not in the primary branch (#50401). Merges [49264], [51673], [52179], [53552], [53895], [56464], [57918], [58157], [57124], [57125], [57249] to the 5.1 branch. Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin, Clorith, afragen, jrf. See #49783, #58867, #61340, #60822, #61216, #60901, #61101, #59416, #59805, #61213. git-svn-id: https://develop.svn.wordpress.org/branches/5.1@58626 602fd350-edb4-49c9-b593-d223f7449a82
1 parent cbb64b8 commit 978aae7

File tree

13 files changed

+253
-638
lines changed

13 files changed

+253
-638
lines changed

.cache/.gitkeep

Whitespace-only changes.

.github/workflows/coding-standards.yml

Lines changed: 19 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -40,105 +40,36 @@ 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
51+
uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@trunk
52+
permissions:
53+
contents: read
6054
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
61-
62-
steps:
63-
- name: Checkout repository
64-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
65-
66-
- name: Set up PHP
67-
uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0
68-
with:
69-
php-version: '7.2'
70-
coverage: none
71-
tools: composer, cs2pr
72-
73-
- name: Log debug information
74-
run: |
75-
php --version
76-
composer --version
77-
78-
- name: Install Composer dependencies
79-
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
80-
with:
81-
composer-options: "--no-progress --no-ansi"
82-
83-
- name: Make Composer packages available globally
84-
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
85-
86-
- name: Log PHPCS debug information
87-
run: phpcs -i
88-
89-
- name: Run PHPCBF on all Core files
90-
run: phpcbf
55+
with:
56+
php-version: '7.2'
57+
old-branch: true
9158

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

13967
slack-notifications:
14068
name: Slack Notifications
14169
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
70+
permissions:
71+
actions: read
72+
contents: read
14273
needs: [ phpcs, jshint ]
14374
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
14475
with:
@@ -152,6 +83,8 @@ jobs:
15283
failed-workflow:
15384
name: Failed workflow tasks
15485
runs-on: ubuntu-latest
86+
permissions:
87+
actions: write
15588
needs: [ phpcs, jshint, slack-notifications ]
15689
if: |
15790
always() &&
@@ -165,7 +98,7 @@ jobs:
16598
16699
steps:
167100
- name: Dispatch workflow run
168-
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
101+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
169102
with:
170103
retries: 2
171104
retry-exempt-status-codes: 418

.github/workflows/javascript-tests.yml

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -38,57 +38,29 @@ 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:
42-
# Runs the QUnit tests for WordPress.
43-
#
44-
# Performs the following steps:
45-
# - Checks out the repository.
46-
# - Logs debug information about the GitHub Action runner.
47-
# - Installs NodeJS.
48-
# - Logs updated debug information.
49-
# _ Installs npm dependencies.
50-
# - Run the WordPress QUnit tests.
46+
# Runs the WordPress Core JavaScript 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:
91-
calling_status: ${{ needs.test-js.result == 'success' && 'success' || needs.test-js.result == 'cancelled' && 'cancelled' || 'failure' }}
63+
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
9264
secrets:
9365
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
9466
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
@@ -98,19 +70,22 @@ jobs:
9870
failed-workflow:
9971
name: Failed workflow tasks
10072
runs-on: ubuntu-latest
101-
needs: [ test-js, slack-notifications ]
73+
permissions:
74+
actions: write
75+
needs: [ slack-notifications ]
10276
if: |
10377
always() &&
10478
github.repository == 'WordPress/wordpress-develop' &&
10579
github.event_name != 'pull_request' &&
10680
github.run_attempt < 2 &&
10781
(
108-
needs.test-js.result == 'cancelled' || needs.test-js.result == 'failure'
82+
contains( needs.*.result, 'cancelled' ) ||
83+
contains( needs.*.result, 'failure' )
10984
)
11085
11186
steps:
11287
- name: Dispatch workflow run
113-
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
88+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
11489
with:
11590
retries: 2
11691
retry-exempt-status-codes: 418

0 commit comments

Comments
 (0)