Skip to content

Commit 7fbcfef

Browse files
committed
Build/Test Tools: Various minor GitHub Action improvements.
This applies several types of improvements to GitHub Action workflows: - Updates to inline documentation to ensure accuracy. - Removal of repetitive or unnecessary debug logging. - Reorganization of some steps to have configuration steps towards the beginning of jobs. - Step name updates for consistency across workflows. Props desrosj, jrf. See #56793. git-svn-id: https://develop.svn.wordpress.org/trunk@54851 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 66706c9 commit 7fbcfef

File tree

8 files changed

+76
-123
lines changed

8 files changed

+76
-123
lines changed

.github/workflows/coding-standards.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ jobs:
4848
# Performs the following steps:
4949
# - Checks out the repository.
5050
# - Sets up PHP.
51-
# - Logs debug information.
5251
# - Configures caching for PHPCS scans.
53-
# - Installs Composer dependencies (use cache if possible).
52+
# - Installs Composer dependencies.
5453
# - Make Composer packages available globally.
55-
# - Logs PHP_CodeSniffer debug information.
5654
# - Runs PHPCS on the full codebase with warnings suppressed.
55+
# - Generate a report for displaying issues as pull request annotations.
5756
# - Runs PHPCS on the `tests` directory without warnings suppressed.
57+
# - Generate a report for displaying `test` directory issues as pull request annotations.
5858
# - Ensures version-controlled files are not modified or deleted.
59+
5960
phpcs:
6061
name: PHP coding standards
6162
runs-on: ubuntu-latest
@@ -73,11 +74,6 @@ jobs:
7374
coverage: none
7475
tools: composer, cs2pr
7576

76-
- name: Log debug information
77-
run: |
78-
php --version
79-
composer --version
80-
8177
# This date is used to ensure that the PHPCS cache is cleared at least once every week.
8278
# http://man7.org/linux/man-pages/man1/date.1.html
8379
- name: "Get last Monday's date"
@@ -98,9 +94,6 @@ jobs:
9894
- name: Make Composer packages available globally
9995
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
10096

101-
- name: Log PHPCS debug information
102-
run: phpcs -i
103-
10497
- name: Run PHPCS on all Core files
10598
id: phpcs-core
10699
run: phpcs -n --report-full --report-checkstyle=./.cache/phpcs-report.xml
@@ -126,10 +119,9 @@ jobs:
126119
#
127120
# Performs the following steps:
128121
# - Checks out the repository.
122+
# - Sets up Node.js.
129123
# - Logs debug information about the GitHub Action runner.
130-
# - Installs Node.js.
131-
# - Logs updated debug information.
132-
# _ Installs npm dependencies.
124+
# - Installs npm dependencies.
133125
# - Run the WordPress JSHint checks.
134126
# - Ensures version-controlled files are not modified or deleted.
135127
jshint:
@@ -144,14 +136,7 @@ jobs:
144136
- name: Checkout repository
145137
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
146138

147-
- name: Log debug information
148-
run: |
149-
npm --version
150-
node --version
151-
git --version
152-
svn --version
153-
154-
- name: Install Node.js
139+
- name: Set up Node.js
155140
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
156141
with:
157142
node-version-file: '.nvmrc'
@@ -161,8 +146,10 @@ jobs:
161146
run: |
162147
npm --version
163148
node --version
149+
git --version
150+
svn --version
164151
165-
- name: Install Dependencies
152+
- name: Install npm Dependencies
166153
run: npm ci
167154

168155
- name: Run JSHint

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

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@ jobs:
3535
# Performs the following steps:
3636
# - Sets environment variables.
3737
# - Checks out the repository.
38+
# - Sets up Node.js.
3839
# - Logs debug information about the GitHub Action runner.
39-
# - Installs Node.js.
40-
# _ Installs npm dependencies.
40+
# - Installs npm dependencies.
4141
# - Builds WordPress to run from the `build` directory.
4242
# - Starts the WordPress Docker container.
43-
# - Logs general debug information.
4443
# - Logs the running Docker containers.
4544
# - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container).
4645
# - Install WordPress within the Docker container.
@@ -61,24 +60,22 @@ jobs:
6160
- name: Checkout repository
6261
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
6362

63+
- name: Set up Node.js
64+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
65+
with:
66+
node-version-file: '.nvmrc'
67+
cache: npm
68+
6469
- name: Log debug information
6570
run: |
6671
npm --version
6772
node --version
6873
curl --version
6974
git --version
7075
svn --version
71-
php --version
72-
php -i
7376
locale -a
7477
75-
- name: Install Node.js
76-
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
77-
with:
78-
node-version-file: '.nvmrc'
79-
cache: npm
80-
81-
- name: Install Dependencies
78+
- name: Install npm Dependencies
8279
run: npm ci
8380

8481
- name: Build WordPress
@@ -88,14 +85,6 @@ jobs:
8885
run: |
8986
npm run env:start
9087
91-
- name: General debug information
92-
run: |
93-
npm --version
94-
node --version
95-
curl --version
96-
git --version
97-
svn --version
98-
9988
- name: Log running Docker containers
10089
run: docker ps -a
10190

.github/workflows/javascript-tests.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ jobs:
4343
#
4444
# Performs the following steps:
4545
# - Checks out the repository.
46+
# - Sets up Node.js.
4647
# - Logs debug information about the GitHub Action runner.
47-
# - Installs Node.js.
48-
# - Logs updated debug information.
49-
# _ Installs npm dependencies.
48+
# - Installs npm dependencies.
5049
# - Run the WordPress QUnit tests.
5150
# - Ensures version-controlled files are not modified or deleted.
5251
test-js:
@@ -59,14 +58,7 @@ jobs:
5958
- name: Checkout repository
6059
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
6160

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
61+
- name: Set up Node.js
7062
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
7163
with:
7264
node-version-file: '.nvmrc'
@@ -76,8 +68,10 @@ jobs:
7668
run: |
7769
npm --version
7870
node --version
71+
git --version
72+
svn --version
7973
80-
- name: Install Dependencies
74+
- name: Install npm Dependencies
8175
run: npm ci
8276

8377
- name: Run QUnit tests

.github/workflows/php-compatibility.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ jobs:
4646
# - Sets up PHP.
4747
# - Logs debug information.
4848
# - Configures caching for PHP compatibility scans.
49-
# - Installs Composer dependencies (use cache if possible).
49+
# - Installs Composer dependencies.
5050
# - Make Composer packages available globally.
51-
# - Logs PHP_CodeSniffer debug information.
5251
# - Runs the PHP compatibility tests.
52+
# - Generate a report for displaying issues as pull request annotations.
5353
# - Ensures version-controlled files are not modified or deleted.
5454
php-compatibility:
5555
name: Check PHP compatibility
@@ -70,7 +70,6 @@ jobs:
7070

7171
- name: Log debug information
7272
run: |
73-
php --version
7473
composer --version
7574
7675
# This date is used to ensure that the PHP compatibility cache is cleared at least once every week.
@@ -93,9 +92,6 @@ jobs:
9392
- name: Make Composer packages available globally
9493
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
9594

96-
- name: Log PHPCS debug information
97-
run: phpcs -i
98-
9995
- name: Run PHP compatibility tests
10096
id: phpcs
10197
run: phpcs --standard=phpcompat.xml.dist --report-full --report-checkstyle=./.cache/phpcs-compat-report.xml

.github/workflows/phpunit-tests.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,20 @@ jobs:
3636
#
3737
# Performs the following steps:
3838
# - Sets environment variables.
39-
# - Sets up the environment variables needed for testing with memcached (if desired).
40-
# - Installs Node.js.
39+
# - Checks out the repository.
40+
# - Sets up Node.js.
41+
# - Logs general debug information about the runner.
4142
# - Installs npm dependencies
4243
# - Configures caching for Composer.
4344
# - Installs Composer dependencies.
4445
# - Logs Docker debug information (about the Docker installation within the runner).
4546
# - Starts the WordPress Docker container.
46-
# - Logs general debug information about the runner.
4747
# - Logs the running Docker containers.
48-
# - Logs debug information from inside the WordPress Docker container.
4948
# - Logs debug information about what's installed within the WordPress Docker containers.
5049
# - Install WordPress within the Docker container.
5150
# - Run the PHPUnit tests.
5251
# - Ensures version-controlled files are not modified or deleted.
5352
# - Checks out the WordPress Test reporter repository.
54-
# - Reconnect the directory to the Git repository.
5553
# - Submit the test results to the WordPress.org host test results.
5654
test-php:
5755
name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }}
@@ -108,13 +106,21 @@ jobs:
108106
- name: Checkout repository
109107
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
110108

111-
- name: Install Node.js
109+
- name: Set up Node.js
112110
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
113111
with:
114112
node-version-file: '.nvmrc'
115113
cache: npm
116114

117-
- name: Install Dependencies
115+
- name: General debug information
116+
run: |
117+
npm --version
118+
node --version
119+
curl --version
120+
git --version
121+
svn --version
122+
123+
- name: Install npm dependencies
118124
run: npm ci
119125

120126
# This date is used to ensure that the Composer cache is refreshed at least once every week.
@@ -155,14 +161,6 @@ jobs:
155161
run: |
156162
npm run env:start
157163
158-
- name: General debug information
159-
run: |
160-
npm --version
161-
node --version
162-
curl --version
163-
git --version
164-
svn --version
165-
166164
- name: Log running Docker containers
167165
run: docker ps -a
168166

.github/workflows/test-and-zip-default-themes.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ jobs:
4949
#
5050
# Performs the following steps:
5151
# - Checks out the repository.
52-
# - Installs Node.js (only when theme has a build process)
53-
# - Installs npm dependencies (only when theme has a build process)
54-
# - Runs the theme build script (only when theme has a build process)
52+
# - Sets up Node.js.
53+
# - Installs npm dependencies.
54+
# - Runs the theme build script.
5555
# - Ensures version-controlled files are not modified or deleted.
5656
test-build-scripts:
5757
name: Test ${{ matrix.theme }} build script
@@ -77,7 +77,7 @@ jobs:
7777
with:
7878
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }}
7979

80-
- name: Install Node.js
80+
- name: Set up Node.js
8181
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
8282
with:
8383
node-version-file: '.nvmrc'

.github/workflows/test-coverage.yml

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,25 @@ env:
3232
LOCAL_PHP_MEMCACHED: ${{ false }}
3333

3434
jobs:
35-
# Sets up WordPress for testing or development use.
35+
# Runs the PHPUnit tests for WordPress.
3636
#
3737
# Performs the following steps:
3838
# - Sets environment variables.
3939
# - Checks out the repository.
40-
# - Checks out the WordPress Importer plugin (needed for the Core PHPUnit tests).
41-
# - Logs debug information about the GitHub Action runner.
42-
# - Installs Node.js.
43-
# _ Installs npm dependencies.
40+
# - Sets up Node.js.
41+
# - Logs general debug information about the runner.
42+
# - Installs npm dependencies
43+
# - Configures caching for Composer.
44+
# - Installs Composer dependencies.
4445
# - Logs Docker debug information (about the Docker installation within the runner).
4546
# - Starts the WordPress Docker container.
46-
# - Logs debug general information.
4747
# - Logs the running Docker containers.
48-
# - Logs WordPress Docker container debug information.
4948
# - Logs debug information about what's installed within the WordPress Docker containers.
5049
# - Install WordPress within the Docker container.
5150
# - Run the PHPUnit tests as a single site.
5251
# - Ensures version-controlled files are not modified or deleted.
5352
# - Upload the single site code coverage report to Codecov.io.
54-
# - Run the PHPUnit tests as a multisite.
53+
# - Run the PHPUnit tests as a multisite installation.
5554
# - Ensures version-controlled files are not modified or deleted.
5655
# - Upload the multisite code coverage report to Codecov.io.
5756
test-coverage-report:
@@ -73,6 +72,12 @@ jobs:
7372
- name: Checkout repository
7473
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
7574

75+
- name: Set up Node.js
76+
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
77+
with:
78+
node-version-file: '.nvmrc'
79+
cache: npm
80+
7681
- name: Log debug information
7782
run: |
7883
echo "$GITHUB_REF"
@@ -82,17 +87,9 @@ jobs:
8287
curl --version
8388
git --version
8489
svn --version
85-
php --version
86-
php -i
8790
locale -a
8891
89-
- name: Install Node.js
90-
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
91-
with:
92-
node-version-file: '.nvmrc'
93-
cache: npm
94-
95-
- name: Install Dependencies
92+
- name: Install npm Dependencies
9693
run: npm ci
9794

9895
# This date is used to ensure that the Composer cache is refreshed at least once every week.
@@ -129,14 +126,6 @@ jobs:
129126
run: |
130127
npm run env:start
131128
132-
- name: General debug information
133-
run: |
134-
npm --version
135-
node --version
136-
curl --version
137-
git --version
138-
svn --version
139-
140129
- name: Log running Docker containers
141130
run: docker ps -a
142131

0 commit comments

Comments
 (0)