1919 uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2020
2121 - name : Set up PHP environment
22- uses : shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
22+ uses : shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2
2323 with :
2424 php-version : ' latest'
2525 extensions : mysql, zip, imagick
@@ -48,23 +48,26 @@ jobs:
4848 echo "CLI_VERSION=$CLI_VERSION" > $GITHUB_ENV
4949 echo "$CLI_VERSION" > cli_version.txt
5050
51- - name : Upload WP-CLI version
52- uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
53- with :
54- name : cli_version
55- path : cli_version.txt
51+ # The version and manifest uploads do not depend on the Phar, so they run
52+ # alongside the build instead of ahead of it.
53+ - parallel :
54+ - name : Upload WP-CLI version
55+ uses : actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
56+ with :
57+ name : cli_version
58+ path : cli_version.txt
5659
57- - name : Upload manifest file
58- uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
59- with :
60- name : manifest
61- path : vendor/wp-cli/wp-cli/manifest.json
60+ - name : Upload manifest file
61+ uses : actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
62+ with :
63+ name : manifest
64+ path : vendor/wp-cli/wp-cli/manifest.json
6265
63- - name : Build the Phar file
64- run : php -dphar.readonly=0 utils/make-phar.php wp-cli.phar --version=$CLI_VERSION
66+ - name : Build the Phar file
67+ run : php -dphar.readonly=0 utils/make-phar.php wp-cli.phar --version=$CLI_VERSION
6568
6669 - name : Upload built Phar file
67- uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
70+ uses : actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
6871 with :
6972 name : wp-cli-phar
7073 path : wp-cli.phar
@@ -112,13 +115,37 @@ jobs:
112115 - name : Check out source code
113116 uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
114117
118+ # Neither the database server nor the built Phar is needed until the tests
119+ # are prepared, so fetch both in the background while PHP and the Composer
120+ # dependencies are set up. The MySQL action only downloads its own
121+ # binaries, so it cannot contend with apt.
122+ - name : Setup MySQL Server
123+ id : setup-mysql
124+ background : true
125+ uses : shogo82148/actions-setup-mysql@13a38f2af408e58a0c80168fc620a63a15357339 # v1
126+ with :
127+ mysql-version : ${{ matrix.mysql }}
128+ auto-start : true
129+ root-password : root
130+ user : wp_cli_test
131+ password : password1
132+ my-cnf : |
133+ default_authentication_plugin=mysql_native_password
134+
135+ - name : Download built Phar file
136+ background : true
137+ uses : actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
138+ with :
139+ name : wp-cli-phar
140+
115141 - name : Install Ghostscript
142+ timeout-minutes : 10
116143 run : |
117144 sudo apt-get update
118145 sudo apt-get install ghostscript -y
119146
120147 - name : Set up PHP environment
121- uses : shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
148+ uses : shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2
122149 with :
123150 php-version : ' ${{ matrix.php }}'
124151 extensions : imagick, mysql, zip
@@ -139,29 +166,15 @@ jobs:
139166 run : |
140167 sudo sed -i 's/^.*policy.*coder.*none.*PDF.*//' /etc/ImageMagick-6/policy.xml
141168
142- - name : Download built Phar file
143- uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
144- with :
145- name : wp-cli-phar
169+ - name : Wait for the MySQL server and the Phar download
170+ wait-all :
146171
147172 - name : Prepare built Phar file for Behat tests
148173 run : |
149174 mkdir -p $WP_CLI_BIN_DIR
150175 mv wp-cli.phar $WP_CLI_BIN_DIR/wp
151176 chmod +x $WP_CLI_BIN_DIR/wp
152177
153- - name : Setup MySQL Server
154- id : setup-mysql
155- uses : shogo82148/actions-setup-mysql@3dcedf762c5e82d781a9e414462785b30208e79c # v1
156- with :
157- mysql-version : ${{ matrix.mysql }}
158- auto-start : true
159- root-password : root
160- user : wp_cli_test
161- password : password1
162- my-cnf : |
163- default_authentication_plugin=mysql_native_password
164-
165178 - name : Configure DB environment
166179 run : |
167180 echo "MYSQL_HOST=127.0.0.1" >> $GITHUB_ENV
@@ -197,25 +210,26 @@ jobs:
197210 repository : wp-cli/builds
198211 token : ${{ secrets.ACTIONS_BOT }}
199212
200- - name : Download WP-CLI version
201- uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
202- with :
203- name : cli_version
213+ - parallel :
214+ - name : Download WP-CLI version
215+ uses : actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
216+ with :
217+ name : cli_version
218+
219+ - name : Download manifest file
220+ uses : actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
221+ with :
222+ name : manifest
223+
224+ - name : Download built Phar file
225+ uses : actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
226+ with :
227+ name : wp-cli-phar
204228
205229 - name : Set new nightly version
206230 run : |
207231 cat cli_version.txt > phar/NIGHTLY_VERSION
208232
209- - name : Download manifest file
210- uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
211- with :
212- name : manifest
213-
214- - name : Download built Phar file
215- uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
216- with :
217- name : wp-cli-phar
218-
219233 - name : Set file name for release branch
220234 if : ${{ contains(github.ref, 'release') }}
221235 run : |
@@ -316,6 +330,14 @@ jobs:
316330 needs : [deploy]
317331
318332 steps :
333+ # The RPM tooling comes from apt, which is slow and independent of the
334+ # checkouts and the Phar download, so install it in the background.
335+ - name : Install RPM build tooling
336+ background : true
337+ run : |
338+ sudo apt-get update
339+ sudo apt-get install rpm rpmlint -y
340+
319341 - name : Check out builds repository
320342 uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
321343 with :
@@ -331,20 +353,18 @@ jobs:
331353 persist-credentials : false
332354
333355 - name : Download built Phar file
334- uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
356+ uses : actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
335357 with :
336358 name : wp-cli-phar
337359
338- - name : Install RPM build tooling
339- run : |
340- sudo apt-get update
341- sudo apt-get install rpm rpmlint -y
342-
343360 - name : Copy RPM build configuration
344361 run : |
345362 cp bundle/utils/wp-cli-rpm.spec .
346363 cp bundle/utils/wp-cli-updaterpm.sh .
347364
365+ - name : Wait for the RPM build tooling
366+ wait-all :
367+
348368 - name : Build RPM package
349369 run : |
350370 bash wp-cli-updaterpm.sh
@@ -405,6 +425,14 @@ jobs:
405425 needs : [build-rpm]
406426
407427 steps :
428+ # The DEB tooling comes from apt, which is slow and independent of the
429+ # checkouts and the Phar download, so install it in the background.
430+ - name : Install DEB build tooling
431+ background : true
432+ run : |
433+ sudo apt-get update
434+ sudo apt-get install fakeroot lintian -y
435+
408436 - name : Check out builds repository
409437 uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
410438 with :
@@ -420,19 +448,17 @@ jobs:
420448 persist-credentials : false
421449
422450 - name : Download built Phar file
423- uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
451+ uses : actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
424452 with :
425453 name : wp-cli-phar
426454
427- - name : Install DEB build tooling
428- run : |
429- sudo apt-get update
430- sudo apt-get install fakeroot lintian -y
431-
432455 - name : Copy DEB build configuration
433456 run : |
434457 cp bundle/utils/wp-cli-updatedeb.sh .
435458
459+ - name : Wait for the DEB build tooling
460+ wait-all :
461+
436462 - name : Build DEB package
437463 run : |
438464 bash wp-cli-updatedeb.sh
0 commit comments