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 : |
@@ -266,6 +280,14 @@ jobs:
266280 needs : [deploy]
267281
268282 steps :
283+ # The RPM tooling comes from apt, which is slow and independent of the
284+ # checkouts and the Phar download, so install it in the background.
285+ - name : Install RPM build tooling
286+ background : true
287+ run : |
288+ sudo apt-get update
289+ sudo apt-get install rpm rpmlint -y
290+
269291 - name : Check out builds repository
270292 uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
271293 with :
@@ -281,20 +303,18 @@ jobs:
281303 persist-credentials : false
282304
283305 - name : Download built Phar file
284- uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
306+ uses : actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
285307 with :
286308 name : wp-cli-phar
287309
288- - name : Install RPM build tooling
289- run : |
290- sudo apt-get update
291- sudo apt-get install rpm rpmlint -y
292-
293310 - name : Copy RPM build configuration
294311 run : |
295312 cp bundle/utils/wp-cli-rpm.spec .
296313 cp bundle/utils/wp-cli-updaterpm.sh .
297314
315+ - name : Wait for the RPM build tooling
316+ wait-all :
317+
298318 - name : Build RPM package
299319 run : |
300320 bash wp-cli-updaterpm.sh
@@ -355,6 +375,14 @@ jobs:
355375 needs : [build-rpm]
356376
357377 steps :
378+ # The DEB tooling comes from apt, which is slow and independent of the
379+ # checkouts and the Phar download, so install it in the background.
380+ - name : Install DEB build tooling
381+ background : true
382+ run : |
383+ sudo apt-get update
384+ sudo apt-get install fakeroot lintian -y
385+
358386 - name : Check out builds repository
359387 uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
360388 with :
@@ -370,19 +398,17 @@ jobs:
370398 persist-credentials : false
371399
372400 - name : Download built Phar file
373- uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
401+ uses : actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
374402 with :
375403 name : wp-cli-phar
376404
377- - name : Install DEB build tooling
378- run : |
379- sudo apt-get update
380- sudo apt-get install fakeroot lintian -y
381-
382405 - name : Copy DEB build configuration
383406 run : |
384407 cp bundle/utils/wp-cli-updatedeb.sh .
385408
409+ - name : Wait for the DEB build tooling
410+ wait-all :
411+
386412 - name : Build DEB package
387413 run : |
388414 bash wp-cli-updatedeb.sh
0 commit comments