@@ -145,10 +145,10 @@ jobs:
145
145
ref : 2.1.x
146
146
phar-checksum : ${{needs.compiler-tests.outputs.checksum}}
147
147
148
- checksum-phar :
149
- name : " Checksum PHAR"
150
- if : github.event_name == 'pull_request' && needs.compiler-tests.outputs.compiler_changed == 'true'
148
+ download-base-sha-phar :
149
+ name : " Download base SHA PHAR"
151
150
needs : compiler-tests
151
+ if : github.event_name == 'pull_request' && needs.compiler-tests.outputs.compiler_changed == 'true'
152
152
runs-on : " ubuntu-latest"
153
153
steps :
154
154
- uses : actions/checkout@v4
@@ -182,16 +182,36 @@ jobs:
182
182
const script = require('./.github/scripts/dist/find-artifact.js');
183
183
await script({github, context, core})
184
184
185
+ # saved to phar-file-checksum/phpstan.phar
185
186
- name : Download old artifact by ID
186
187
uses : actions/download-artifact@v4
187
188
with :
188
189
artifact-ids : ${{ steps.find-artifact.outputs.artifact_id }}
189
190
run-id : ${{ steps.find-artifact.outputs.run_id }}
190
191
github-token : ${{ secrets.GITHUB_TOKEN }}
191
192
193
+ - name : " Upload old artifact"
194
+ uses : actions/upload-artifact@v4
195
+ with :
196
+ name : phar-file-checksum-base
197
+ path : phar-file-checksum/phpstan.phar
198
+
199
+ checksum-phar :
200
+ name : " Checksum PHAR"
201
+ needs :
202
+ - compiler-tests
203
+ - download-base-sha-phar
204
+ runs-on : " ubuntu-latest"
205
+ steps :
206
+ # saved to phpstan.phar
207
+ - name : " Download base phpstan.phar"
208
+ uses : actions/download-artifact@v4
209
+ with :
210
+ name : phar-file-checksum-base
211
+
192
212
- name : " Save old checksum"
193
213
id : " old_checksum"
194
- run : echo "md5=$(md5sum phar-file-checksum/ phpstan.phar | cut -d' ' -f1)" >> $GITHUB_OUTPUT
214
+ run : echo "md5=$(md5sum phpstan.phar | cut -d' ' -f1)" >> $GITHUB_OUTPUT
195
215
196
216
- name : " Assert checksum"
197
217
run : |
@@ -201,54 +221,24 @@ jobs:
201
221
202
222
phar-prefix-diff :
203
223
name : " PHAR Prefix Diff"
204
- if : github.event_name == 'pull_request' && needs.compiler-tests.outputs.compiler_changed == 'true'
205
- needs : compiler-tests
224
+ needs : download-base-sha-phar
206
225
runs-on : " ubuntu-latest"
207
226
steps :
208
227
- uses : actions/checkout@v4
209
228
210
- - name : Get base commit SHA
211
- id : base
212
- run : echo "base_sha=${{ github.event.pull_request.base.sha }}" >> "$GITHUB_OUTPUT"
213
-
214
- - name : Set up Node.js
215
- uses : actions/setup-node@v4
216
- with :
217
- node-version : 20
218
-
219
- - name : Install dependencies
220
- working-directory : .github/scripts
221
- run : npm ci
222
-
223
- - name : " Compile TS scripts"
224
- working-directory : .github/scripts
225
- run : npx tsc
226
-
227
- - name : Find phar-file-checksum from base commit
228
- id : find-artifact
229
- uses : actions/github-script@v7
230
- env :
231
- BASE_SHA : ${{ steps.base.outputs.base_sha }}
232
- ARTIFACT_NAME : phar-file-checksum
233
- WORKFLOW_NAME : Compile PHAR
234
- with :
235
- script : |
236
- const script = require('./.github/scripts/dist/find-artifact.js');
237
- await script({github, context, core})
238
-
239
229
# saved to phar-file-checksum/phpstan.phar
240
- - name : Download old artifact by ID
230
+ - name : " Download phpstan.phar "
241
231
uses : actions/download-artifact@v4
242
232
with :
243
- artifact-ids : ${{ steps.find-artifact.outputs.artifact_id }}
244
- run-id : ${{ steps.find-artifact.outputs.run_id }}
245
- github-token : ${{ secrets.GITHUB_TOKEN }}
233
+ name : phar-file-checksum
234
+ path : phar-file-checksum
246
235
247
- # saved to phpstan.phar
248
- - name : " Download phpstan.phar"
236
+ # saved to phar-file-checksum-base/ phpstan.phar
237
+ - name : " Download base phpstan.phar"
249
238
uses : actions/download-artifact@v4
250
239
with :
251
- name : phar-file-checksum
240
+ name : phar-file-checksum-base
241
+ path : phar-file-checksum-base
252
242
253
243
- name : " Install PHP"
254
244
uses : " shivammathur/setup-php@v2"
@@ -264,10 +254,10 @@ jobs:
264
254
run : " composer install"
265
255
266
256
- name : " Extract old phpstan.phar"
267
- run : " php .. /box/vendor/bin/box extract phar-file-checksum/phpstan.phar phar-old"
257
+ run : " php compiler /box/vendor/bin/box extract phar-file-checksum-base /phpstan.phar phar-old"
268
258
269
259
- name : " Extract new phpstan.phar"
270
- run : " php .. /box/vendor/bin/box extract phpstan.phar phar-new"
260
+ run : " php compiler /box/vendor/bin/box extract phar-file-checksum/ phpstan.phar phar-new"
271
261
272
262
- name : " List prefix locations in old PHAR"
273
263
run : " php .github/scripts/listPrefix.php ${{ github.workspace }}/phar-old > phar-old.txt"
0 commit comments