Skip to content

Commit 820eff1

Browse files
committed
Build/Test Tools: Make use of new reusable workflows for 5.9.
This updates the 5.9 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). Merges [53895], [53552], [56113], [56114], [57918], [58157], [57124], [57125], [57249] to the 5.9 branch. Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin, Clorith, afragen. See #55700, #61340, #60822, #61216, #60901, #61101, #59416, #59805, #61213, #58661. git-svn-id: https://develop.svn.wordpress.org/branches/5.9@58358 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 413abc5 commit 820eff1

File tree

11 files changed

+294
-727
lines changed

11 files changed

+294
-727
lines changed

.github/workflows/coding-standards.yml

Lines changed: 17 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -40,130 +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-
# - Configures caching for PHPCS scans.
53-
# - Installs Composer dependencies (use cache if possible).
54-
# - Make Composer packages available globally.
55-
# - Logs PHP_CodeSniffer debug information.
56-
# - Runs PHPCS on the full codebase with warnings suppressed.
57-
# - Runs PHPCS on the `tests` directory without warnings suppressed.
58-
# - Ensures version-controlled files are not modified or deleted.
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-
# This date is used to ensure that the PHPCS cache is cleared at least once every week.
82-
# http://man7.org/linux/man-pages/man1/date.1.html
83-
- name: "Get last Monday's date"
84-
id: get-date
85-
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
86-
87-
- name: Cache PHPCS scan cache
88-
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
89-
with:
90-
path: .cache/phpcs.json
91-
key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }}
92-
93-
- name: Install Composer dependencies
94-
uses: ramsey/composer-install@83af392bf5f031813d25e6fe4cd626cdba9a2df6 # v2.2.0
95-
with:
96-
composer-options: "--no-progress --no-ansi"
97-
98-
- name: Make Composer packages available globally
99-
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
100-
101-
- name: Log PHPCS debug information
102-
run: phpcs -i
103-
104-
- name: Run PHPCS on all Core files
105-
run: phpcs -q -n --report=checkstyle | cs2pr
106-
107-
- name: Check test suite files for warnings
108-
run: phpcs tests -q --report=checkstyle | cs2pr
109-
110-
- name: Ensure version-controlled files are not modified during the tests
111-
run: git diff --exit-code
55+
with:
56+
php-version: '7.4'
11257

11358
# Runs the JavaScript coding standards checks.
114-
#
115-
# JSHint violations are not currently reported inline with annotations.
116-
#
117-
# Performs the following steps:
118-
# - Checks out the repository.
119-
# - Logs debug information about the GitHub Action runner.
120-
# - Installs Node.js.
121-
# - Logs updated debug information.
122-
# _ Installs npm dependencies.
123-
# - Run the WordPress JSHint checks.
124-
# - Ensures version-controlled files are not modified or deleted.
12559
jshint:
12660
name: JavaScript coding standards
127-
runs-on: ubuntu-latest
128-
timeout-minutes: 20
61+
uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk
62+
permissions:
63+
contents: read
12964
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
130-
env:
131-
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
132-
133-
steps:
134-
- name: Checkout repository
135-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
136-
137-
- name: Log debug information
138-
run: |
139-
npm --version
140-
node --version
141-
git --version
142-
svn --version
143-
144-
- name: Install Node.js
145-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
146-
with:
147-
node-version-file: '.nvmrc'
148-
cache: npm
149-
150-
- name: Log debug information
151-
run: |
152-
npm --version
153-
node --version
154-
155-
- name: Install Dependencies
156-
run: npm ci
157-
158-
- name: Run JSHint
159-
run: npm run grunt jshint
160-
161-
- name: Ensure version-controlled files are not modified or deleted
162-
run: git diff --exit-code
16365

16466
slack-notifications:
16567
name: Slack Notifications
16668
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
69+
permissions:
70+
actions: read
71+
contents: read
16772
needs: [ phpcs, jshint ]
16873
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
16974
with:
@@ -177,6 +82,8 @@ jobs:
17782
failed-workflow:
17883
name: Failed workflow tasks
17984
runs-on: ubuntu-latest
85+
permissions:
86+
actions: write
18087
needs: [ phpcs, jshint, slack-notifications ]
18188
if: |
18289
always() &&

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

Lines changed: 18 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -26,116 +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
31-
LOCAL_PHP: 8.0-fpm
3235

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

13553
failed-workflow:
13654
name: Failed workflow tasks
13755
runs-on: ubuntu-latest
138-
needs: [ e2e-tests, slack-notifications ]
56+
permissions:
57+
actions: write
58+
needs: [ e2e-tests ]
13959
if: |
14060
always() &&
14161
github.repository == 'WordPress/wordpress-develop' &&
@@ -144,7 +64,6 @@ jobs:
14464
(
14565
needs.e2e-tests.result == 'cancelled' || needs.e2e-tests.result == 'failure'
14666
)
147-
14867
steps:
14968
- name: Dispatch workflow run
15069
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0

.github/workflows/javascript-tests.yml

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -38,57 +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.
51-
# - Ensures version-controlled files are not modified or deleted.
5247
test-js:
5348
name: QUnit Tests
54-
runs-on: ubuntu-latest
55-
timeout-minutes: 20
49+
uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@trunk
50+
permissions:
51+
contents: read
5652
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
5753

58-
steps:
59-
- name: Checkout repository
60-
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
61-
62-
- name: Log debug information
63-
run: |
64-
npm --version
65-
node --version
66-
git --version
67-
svn --version
68-
69-
- name: Install Node.js
70-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
71-
with:
72-
node-version-file: '.nvmrc'
73-
cache: npm
74-
75-
- name: Log debug information
76-
run: |
77-
npm --version
78-
node --version
79-
80-
- name: Install Dependencies
81-
run: npm ci
82-
83-
- name: Run QUnit tests
84-
run: npm run grunt qunit:compiled
85-
86-
- name: Ensure version-controlled files are not modified or deleted
87-
run: git diff --exit-code
88-
8954
slack-notifications:
9055
name: Slack Notifications
9156
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
57+
permissions:
58+
actions: read
59+
contents: read
9260
needs: [ test-js ]
9361
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
9462
with:
@@ -102,6 +70,8 @@ jobs:
10270
failed-workflow:
10371
name: Failed workflow tasks
10472
runs-on: ubuntu-latest
73+
permissions:
74+
actions: write
10575
needs: [ test-js, slack-notifications ]
10676
if: |
10777
always() &&

0 commit comments

Comments
 (0)