Skip to content

Commit 6ee9f96

Browse files
committed
Build/Test Tools: Make use of new reusable workflows for 5.8.
This updates the 5.8 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. - Move the Memcached container into the Docker Compose config (#55700). - Configure Xdebug modes in the local Docker environment (#56022). - Cache the results of `PHP_CodeSniffer` runs (#49783). Merges [52179], [53895], [53552], [56113], [56114], [57918], [58157], [57124], [57125], [57249] to the 5.8 branch. Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin, Clorith, afragen, jrf. See #48783, #55700, #61340, #60822, #61216, #60901, #61101, #59416, #59805, #61213, #58661. git-svn-id: https://develop.svn.wordpress.org/branches/5.8@58597 602fd350-edb4-49c9-b593-d223f7449a82
1 parent ed4997d commit 6ee9f96

16 files changed

+298
-761
lines changed

.cache/.gitkeep

Whitespace-only changes.

.github/workflows/coding-standards.yml

Lines changed: 18 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -40,118 +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.
57-
# - Ensures version-controlled files are not modified or deleted.
58-
# - todo: Configure Slack notifications for failing scans.
5949
phpcs:
6050
name: PHP coding standards
61-
runs-on: ubuntu-latest
62-
timeout-minutes: 20
51+
uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@trunk
52+
permissions:
53+
contents: read
6354
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
64-
65-
steps:
66-
- name: Checkout repository
67-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
68-
69-
- name: Set up PHP
70-
uses: shivammathur/setup-php@d30ad8b1843ace22e6698ab99bbafaa747b6bd0d # v2.24.0
71-
with:
72-
php-version: '7.4'
73-
coverage: none
74-
tools: composer, cs2pr
75-
76-
- name: Log debug information
77-
run: |
78-
php --version
79-
composer --version
80-
81-
- name: Install Composer dependencies
82-
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
83-
with:
84-
composer-options: "--no-progress --no-ansi"
85-
86-
- name: Make Composer packages available globally
87-
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
88-
89-
- name: Log PHPCS debug information
90-
run: phpcs -i
91-
92-
- name: Run PHPCS on all Core files
93-
run: phpcs -q -n --report=checkstyle | cs2pr
94-
95-
- name: Check test suite files for warnings
96-
run: phpcs tests -q --report=checkstyle | cs2pr
97-
98-
- name: Ensure version-controlled files are not modified during the tests
99-
run: git diff --exit-code
55+
with:
56+
php-version: '7.4'
10057

10158
# Runs the JavaScript coding standards checks.
102-
#
103-
# JSHint violations are not currently reported inline with annotations.
104-
#
105-
# Performs the following steps:
106-
# - Checks out the repository.
107-
# - Logs debug information about the GitHub Action runner.
108-
# - Installs Node.js.
109-
# - Logs updated debug information.
110-
# _ Installs npm dependencies.
111-
# - Run the WordPress JSHint checks.
112-
# - Ensures version-controlled files are not modified or deleted.
11359
jshint:
11460
name: JavaScript coding standards
115-
runs-on: ubuntu-latest
116-
timeout-minutes: 20
61+
uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk
62+
permissions:
63+
contents: read
11764
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
118-
env:
119-
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
120-
121-
steps:
122-
- name: Checkout repository
123-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
124-
125-
- name: Log debug information
126-
run: |
127-
npm --version
128-
node --version
129-
git --version
130-
svn --version
131-
132-
- name: Install Node.js
133-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
134-
with:
135-
node-version-file: '.nvmrc'
136-
cache: npm
137-
138-
- name: Log debug information
139-
run: |
140-
npm --version
141-
node --version
142-
143-
- name: Install Dependencies
144-
run: npm ci
145-
146-
- name: Run JSHint
147-
run: npm run grunt jshint
148-
149-
- name: Ensure version-controlled files are not modified or deleted
150-
run: git diff --exit-code
15165

15266
slack-notifications:
15367
name: Slack Notifications
15468
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
69+
permissions:
70+
actions: read
71+
contents: read
15572
needs: [ phpcs, jshint ]
15673
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
15774
with:
@@ -165,6 +82,8 @@ jobs:
16582
failed-workflow:
16683
name: Failed workflow tasks
16784
runs-on: ubuntu-latest
85+
permissions:
86+
actions: write
16887
needs: [ phpcs, jshint, slack-notifications ]
16988
if: |
17089
always() &&
@@ -175,10 +94,9 @@ jobs:
17594
needs.phpcs.result == 'cancelled' || needs.phpcs.result == 'failure' ||
17695
needs.jshint.result == 'cancelled' || needs.jshint.result == 'failure'
17796
)
178-
17997
steps:
18098
- name: Dispatch workflow run
181-
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
99+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
182100
with:
183101
retries: 2
184102
retry-exempt-status-codes: 418

.github/workflows/end-to-end-tests.yml

Lines changed: 19 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -26,115 +26,36 @@ concurrency:
2626
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
2727
cancel-in-progress: true
2828

29+
# Disable permissions for all available scopes by default.
30+
# Any needed permissions should be configured at the job level.
31+
permissions: {}
32+
2933
env:
3034
LOCAL_DIR: build
3135

3236
jobs:
3337
# Runs the end-to-end test suite.
34-
#
35-
# Performs the following steps:
36-
# - Sets environment variables.
37-
# - Checks out the repository.
38-
# - Logs debug information about the GitHub Action runner.
39-
# - Installs Node.js.
40-
# _ Installs npm dependencies.
41-
# - Builds WordPress to run from the `build` directory.
42-
# - Starts the WordPress Docker container.
43-
# - Logs general debug information.
44-
# - Logs the running Docker containers.
45-
# - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container).
46-
# - Install WordPress within the Docker container.
47-
# - Run the E2E tests.
48-
# - Ensures version-controlled files are not modified or deleted.
4938
e2e-tests:
50-
name: E2E Tests
51-
runs-on: ubuntu-latest
52-
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
5343
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
54-
55-
steps:
56-
- name: Configure environment variables
57-
run: |
58-
echo "PHP_FPM_UID=$(id -u)" >> $GITHUB_ENV
59-
echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV
60-
61-
- name: Checkout repository
62-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
63-
64-
- name: Log debug information
65-
run: |
66-
npm --version
67-
node --version
68-
curl --version
69-
git --version
70-
svn --version
71-
php --version
72-
php -i
73-
locale -a
74-
75-
- name: Install Node.js
76-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
77-
with:
78-
node-version-file: '.nvmrc'
79-
cache: npm
80-
81-
- name: Install Dependencies
82-
run: npm ci
83-
84-
- name: Build WordPress
85-
run: npm run build
86-
87-
- name: Start Docker environment
88-
run: |
89-
npm run env:start
90-
91-
- name: General debug information
92-
run: |
93-
npm --version
94-
node --version
95-
curl --version
96-
git --version
97-
svn --version
98-
99-
- name: Log running Docker containers
100-
run: docker ps -a
101-
102-
- name: Docker debug information
103-
run: |
104-
docker -v
105-
docker-compose -v
106-
docker-compose run --rm mysql mysql --version
107-
docker-compose run --rm php php --version
108-
docker-compose run --rm php php -m
109-
docker-compose run --rm php php -i
110-
docker-compose run --rm php locale -a
111-
112-
- name: Install WordPress
113-
run: npm run env:install
114-
115-
- name: Run E2E tests
116-
run: npm run test:e2e
117-
118-
- name: Ensure version-controlled files are not modified or deleted
119-
run: git diff --exit-code
120-
121-
slack-notifications:
122-
name: Slack Notifications
123-
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
124-
needs: [ e2e-tests ]
125-
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 ]
12648
with:
127-
calling_status: ${{ needs.e2e-tests.result == 'success' && 'success' || needs.e2e-tests.result == 'cancelled' && 'cancelled' || 'failure' }}
128-
secrets:
129-
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
130-
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
131-
SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }}
132-
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
13352

13453
failed-workflow:
13554
name: Failed workflow tasks
13655
runs-on: ubuntu-latest
137-
needs: [ e2e-tests, slack-notifications ]
56+
permissions:
57+
actions: write
58+
needs: [ e2e-tests ]
13859
if: |
13960
always() &&
14061
github.repository == 'WordPress/wordpress-develop' &&
@@ -143,10 +64,9 @@ jobs:
14364
(
14465
needs.e2e-tests.result == 'cancelled' || needs.e2e-tests.result == 'failure'
14566
)
146-
14767
steps:
14868
- name: Dispatch workflow run
149-
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
69+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
15070
with:
15171
retries: 2
15272
retry-exempt-status-codes: 418

0 commit comments

Comments
 (0)