Repository navigation
662 lines (613 loc) · 27.3 KB
/
Copy pathintegration-tests.yml
File metadata and controls
662 lines (613 loc) · 27.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: "Integration tests"
on:
workflow_call:
inputs:
ref:
description: 'phpstan/phpstan ref to checkout'
required: true
type: string
phar-checksum:
description: 'PHAR checksum from reproducible build (please rebase)'
required: true
type: string
secrets:
phpstan-bot-token:
required: false
jobs:
check-phar-checksum:
name: "Check PHAR checksum"
runs-on: "ubuntu-latest"
outputs:
checksum-result: ${{ steps.checksum-difference.outputs.result }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: "Checkout"
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
repository: "phpstan/phpstan"
ref: ${{ inputs.ref }}
- name: "Check PHAR checksum"
id: checksum-difference
run: |
checksum="${{ inputs.phar-checksum }}"
if [[ $(head -n 1 .phar-checksum) != "$checksum" ]]; then
echo "result=different" >> "$GITHUB_OUTPUT"
else
echo "result=same" >> "$GITHUB_OUTPUT"
fi
integration-tests:
name: "Integration - ${{ matrix.name }}"
runs-on: "ubuntu-latest"
timeout-minutes: 30
needs: check-phar-checksum
if: "needs.check-phar-checksum.outputs.checksum-result == 'different'"
strategy:
fail-fast: false
matrix:
include:
- php-version: 8.4
name: Rector tests
script: |
git clone https://github.com/rectorphp/rector-src.git e2e/integration/repo
cd e2e/integration/repo
git checkout 2.3.2
cp ../rector-composer.lock composer.lock
composer install
cp ../../../phpstan.phar vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php vendor/phpstan/phpstan/bootstrap.php
vendor/bin/phpunit
- php-version: 8.4
name: Rector downgrade PHP tests
script: |
git clone https://github.com/rectorphp/rector-downgrade-php.git e2e/integration/repo
cd e2e/integration/repo
git checkout a110e2fcf94e7513739f54bc27cd473ba9eff5d5
cp ../rector-downgrade-php-composer.lock composer.lock
composer install
cp ../../../phpstan.phar vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php vendor/phpstan/phpstan/bootstrap.php
vendor/bin/phpunit
- php-version: 8.4
name: Symplify tests
script: |
git clone https://github.com/symplify/phpstan-rules.git e2e/integration/repo
cd e2e/integration/repo
git checkout 947b9c72900454bb0a13c461456be116acc9e258
cp ../symplify-composer.lock composer.lock
composer install
cp ../../../phpstan.phar vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php vendor/phpstan/phpstan/bootstrap.php
vendor/bin/phpunit
- php-version: 8.4
name: Larastan tests PHP 8.4, ^12.48
script: |
git clone https://github.com/larastan/larastan.git e2e/integration/repo
cd e2e/integration/repo
git checkout 0ac2cfa87ac815a460918b0331b77d9f9e9b863d
cp ../larastan-composer.lock composer.lock
composer install
cp ../../../phpstan.phar vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php vendor/phpstan/phpstan/bootstrap.php
composer run-script test:unit
- php-version: 8.4
name: Carbon tests
script: |
git clone https://github.com/briannesbitt/Carbon.git -b 3.10.3 --depth 1 e2e/integration/repo
cd e2e/integration/repo
composer install
cp ../../../phpstan.phar vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php vendor/phpstan/phpstan/bootstrap.php
vendor/bin/phpunit tests/PHPStan
- php-version: 8.1
name: shipmonk/phpstan-rules tests
script: |
git clone https://github.com/shipmonk-rnd/phpstan-rules.git e2e/integration/repo
cd e2e/integration/repo
git checkout 7223e6b64741f4b01c7f3c4af1604b485e11fff5
composer install
cp ../../../phpstan.phar vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php vendor/phpstan/phpstan/bootstrap.php
vendor/bin/phpunit tests
- php-version: 8.4
name: shipmonk/dead-code-detector tests
script: |
git clone https://github.com/shipmonk-rnd/dead-code-detector.git e2e/integration/repo
cd e2e/integration/repo
git checkout 9dc312dacd817f253a9519703d2c4c3d86579d27
composer install
cp ../../../phpstan.phar vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php vendor/phpstan/phpstan/bootstrap.php
vendor/bin/phpunit tests
# - php-version: 8.4
# name: efabrica-team/phpstan-latte tests
# script: |
# git clone https://github.com/efabrica-team/phpstan-latte.git --depth 1 -b 0.19.0 e2e/integration/repo
# cd e2e/integration/repo
# composer install
# cp ../../../phpstan.phar vendor/phpstan/phpstan/phpstan.phar
# cp ../../../phpstan vendor/phpstan/phpstan/phpstan
# cp ../../../bootstrap.php vendor/phpstan/phpstan/bootstrap.php
# vendor/bin/phpunit
- php-version: 8.2
name: Bladestan tests
script: |
git clone https://github.com/bladestan/bladestan.git e2e/integration/repo
cd e2e/integration/repo
git checkout f1dedaeb283718cf78ac02ba4d013d3a3b86eda1
cp ../bladestan-composer.lock composer.lock
composer install
cp ../../../phpstan.phar vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php vendor/phpstan/phpstan/bootstrap.php
vendor/bin/phpunit
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: "Checkout"
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
repository: "phpstan/phpstan"
ref: ${{ inputs.ref }}
- name: "Install PHP"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
ini-file: development
- name: "Install Node"
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "20"
- uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3
- name: "Download phpstan.phar"
uses: Wandalen/wretry.action@e68c23e6309f2871ca8ae4763e7629b9c258e1ea # v3.8.0
with:
action: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with: |
name: phar-file
attempt_limit: 5
attempt_delay: 1000
- name: "Tests"
run: "${{ matrix.script }}"
env:
COMPOSER_NO_SECURITY_BLOCKING: 1
integration-run-phpstan:
name: "Integration - ${{ matrix.repo }}"
runs-on: "ubuntu-latest"
timeout-minutes: 30
needs: check-phar-checksum
if: "needs.check-phar-checksum.outputs.checksum-result == 'different'"
strategy:
fail-fast: false
matrix:
include:
- php-version: 8.4
repo: rectorphp/rector-src
ref: 2.3.2
setup: |
cp ../rector-composer.lock composer.lock
composer install
phpstan-command: ../../../phpstan.phar analyse -c ../rector.neon
baseline-file: rector-baseline.neon
- php-version: 8.4
repo: rectorphp/rector-downgrade-php
ref: a110e2fcf94e7513739f54bc27cd473ba9eff5d5
setup: |
cp ../rector-downgrade-php-composer.lock composer.lock
COMPOSER_ROOT_VERSION=dev-main composer install
phpstan-command: ../../../phpstan.phar analyse -c ../rector-downgrade-php.neon
baseline-file: rector-downgrade-php-baseline.neon
- php-version: 8.4
repo: sebastianbergmann/phpunit
ref: 12.4.5
setup: |
export COMPOSER_ROOT_VERSION=12.4.5
composer install
composer install --working-dir tools/.phpstan
cp ../../../phpstan.phar tools/.phpstan/vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan tools/.phpstan/vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php tools/.phpstan/vendor/phpstan/phpstan/bootstrap.php
phpstan-command: tools/.phpstan/vendor/bin/phpstan analyse -c ../phpunit.neon
baseline-file: phpunit-baseline.neon
- php-version: 8.2
repo: laravel/framework
ref: 00f0216e493867f399401397cc40347f869a7e1e
setup: |
composer install
phpstan-command: ../../../phpstan.phar analyse -c phpstan.src.neon.dist
baseline-file: laravel-baseline.neon
- php-version: 8.2
repo: laravel/framework
ref: 00f0216e493867f399401397cc40347f869a7e1e
setup: |
composer install
phpstan-command: ../../../phpstan.phar analyse -c phpstan.types.neon.dist
baseline-file: laravel-types-baseline.neon
- php-version: 8.4
repo: Roave/BetterReflection
ref: 4b9918a78aa52742f40f33402b75739ecf82d48e
setup: |
composer install
composer install --working-dir tools
cp ../../../phpstan.phar tools/vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan tools/vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php tools/vendor/phpstan/phpstan/bootstrap.php
phpstan-command: tools/vendor/bin/phpstan analyse -c ../better-reflection.neon
baseline-file: better-reflection-baseline.neon
# - php-version: 8.1
# repo: composer/composer
# ref: e4038e5e3bffe22cb815dc1663ea76be96d4222e
# setup: |
# composer install
# composer config platform --unset && composer update
# vendor/bin/simple-phpunit --filter NO_TEST_JUST_AUTOLOAD_THANKS
# phpstan-command: ../../../phpstan.phar analyse -c ../composer.neon
# baseline-file: composer-baseline.neon
- php-version: 8.4
repo: nextras/orm
ref: 274ef5b74d596f01528747deee26589706531c82
setup: |
composer install
phpstan-command: ../../../phpstan.phar analyse -c ../nextras.neon
baseline-file: nextras-baseline.neon
- php-version: 8.4
repo: slevomat/coding-standard
ref: 6eff0ed543159cd8bd52f22b7cfd093f483598de
setup: |
composer install
phpstan-command: ../../../phpstan.phar analyse -c ../slevomat-cs.neon
baseline-file: slevomat-cs-baseline.neon
- php-version: 8.4
repo: slevomat/coding-standard
ref: 6eff0ed543159cd8bd52f22b7cfd093f483598de
setup: |
composer install
phpstan-command: ../../../phpstan.phar analyse -c build/PHPStan/phpstan.tests.neon
baseline-file: slevomat-cs-tests-baseline.neon
- php-version: 8.4
repo: symplify/phpstan-rules
ref: 947b9c72900454bb0a13c461456be116acc9e258
setup: |
cp ../symplify-composer.lock composer.lock
composer install
phpstan-command: ../../../phpstan analyse -c ../symplify.neon
baseline-file: symplify-baseline.neon
- php-version: 8.4
repo: larastan/larastan
ref: 0ac2cfa87ac815a460918b0331b77d9f9e9b863d
setup: |
cp ../larastan-composer.lock composer.lock
composer install
cp ../../../phpstan.phar vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php vendor/phpstan/phpstan/bootstrap.php
phpstan-command: ../../../phpstan.phar analyse -c ../larastan.neon
baseline-file: larastan-baseline.neon
- php-version: 8.4
repo: bitExpert/phpstan-magento
ref: f5640e72f0cfaa966dcd329ae2ffd1a789321c7a
setup: |
composer install
phpstan-command: ../../../phpstan.phar analyse -c ../magento.neon
baseline-file: magento-baseline.neon
# - php-version: 8.1
# repo: PrestaShop/PrestaShop
# ref: 8.0.0
# setup: |
# composer install
# phpstan-command: ../../../phpstan.phar analyse -c ../prestashop.neon
# baseline-file: prestashop-baseline.neon
- php-version: 8.4
repo: shopware/shopware
ref: v6.7.6.2
setup: |
composer install
composer require --dev phpstan/phpstan:^2.1.35 phpstan/phpstan-phpunit:^2.0.12 phpstan/phpstan-symfony:^2.0.11
composer run framework:schema:dump
php src/Core/DevOps/StaticAnalyze/phpstan-bootstrap.php
phpstan-command: ../../../phpstan.phar analyse -c ../shopware.neon
baseline-file: shopware-baseline.neon
- php-version: 8.4
repo: Sylius/Sylius
ref: v2.1.5
setup: |
export DATABASE_URL=sqlite:///%kernel.project_dir%/var/data.db
cp ../sylius-composer.lock composer.lock
composer install
phpstan-command: ../../../phpstan.phar analyse -c ../sylius.neon
baseline-file: sylius-baseline.neon
- php-version: 8.4
repo: shopsys/shopsys
ref: v18.0.0
setup: |
cp ../shopsys-composer.lock composer.lock
composer install
# from build.xml
phpstan-command: ../../../phpstan.phar analyse -c ../shopsys.neon -l 5 packages/*/src packages/*/tests utils/*/src utils/*/tests project-base/app/app project-base/app/src
- php-version: 8.4
repo: shopsys/shopsys
ref: v18.0.0
phpstan-cwd: e2e/integration/repo/project-base/app
setup: |
cp ../shopsys-composer.lock composer.lock
COMPOSER_ROOT_VERSION=18.0.0 composer install
rm parameters_monorepo.yaml
cd project-base/app
cp ../../../shopsys-project-base-composer.lock composer.lock
COMPOSER_ROOT_VERSION=18.0.0 composer install
# test project-base separately
phpstan-command: ../../../../../phpstan.phar analyse -c ../../../shopsys-project-base.neon -l 5 src tests
baseline-file: ../../shopsys-project-base-baseline.neon
- php-version: 8.4
repo: doctrine/orm
ref: 3.5.8
setup: |
composer install
phpstan-command: ../../../phpstan.phar analyse -c ../doctrine-orm.neon
baseline-file: doctrine-orm-baseline.neon
- php-version: 8.4
repo: doctrine/collections
ref: 2790cb57e6510e4404873bdca6688e447550d720
setup: |
composer install
phpstan-command: ../../../phpstan.phar analyse -c ../doctrine-collections.neon
baseline-file: doctrine-collections-baseline.neon
- php-version: 8.4
repo: doctrine/dbal
ref: 4.2.2
setup: |
composer install
phpstan-command: ../../../phpstan.phar analyse -c ../doctrine-dbal.neon
baseline-file: doctrine-dbal-baseline.neon
# - php-version: 8.1
# repo: doctrine/common
# ref: a6851094b28ac4bd673d6c82d6a8c6cff1f2ca3c
# setup: |
# composer install
# phpstan-command: ../../../phpstan.phar analyse
# baseline-file: doctrine-common-baseline.neon
# - php-version: 8.1
# repo: doctrine/persistence
# ref: 3.0.3
# setup: |
# composer install
# phpstan-command: ../../../phpstan.phar analyse -c ../doctrine-persistence.neon
# baseline-file: doctrine-persistence-baseline.neon
- php-version: 8.1
repo: shipmonk-rnd/phpstan-rules
ref: 7223e6b64741f4b01c7f3c4af1604b485e11fff5
setup: |
composer install
cp ../../../phpstan.phar vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php vendor/phpstan/phpstan/bootstrap.php
phpstan-command: vendor/bin/phpstan analyse -c ../shipmonk.neon
baseline-file: shipmonk-rnd-baseline.neon
- php-version: 8.4
repo: shipmonk-rnd/dead-code-detector
ref: 9dc312dacd817f253a9519703d2c4c3d86579d27
setup: |
composer install
cp ../../../phpstan.phar vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php vendor/phpstan/phpstan/bootstrap.php
phpstan-command: vendor/bin/phpstan analyse -c ../shipmonk-dead-code-detector.neon
baseline-file: shipmonk-dead-code-detector-baseline.neon
- php-version: 8.4
repo: drupal/drupal
ref: 11.2.4
setup: |
composer install
phpstan-command: ../../../phpstan.phar analyse -c ../drupal.neon
baseline-file: drupal-baseline.neon
- php-version: 8.5
repo: WordPress/wordpress-develop
ref: 7924b71d7a2392a1ff27e09cdea6d4be809a4a34
setup: |
composer install
npm ci --ignore-scripts
npm run build:dev
phpstan-command: ../../../phpstan.phar analyse -c ../wordpress.neon --memory-limit=2G
baseline-file: wordpress-baseline.neon
- php-version: 8.4
repo: briannesbitt/Carbon
ref: 3.11.0
setup: |
composer install
phpstan-command: ../../../phpstan.phar analyse -c ../carbon.neon
baseline-file: carbon-baseline.neon
- php-version: 8.4
repo: nikic/PHP-Parser
ref: v5.6.1
setup: |
composer install
phpstan-command: ../../../phpstan.phar analyse
baseline-file: php-parser-baseline.neon
- php-version: 8.4
repo: efabrica-team/phpstan-latte
ref: 0.19.0
setup: |
composer install
cp ../../../phpstan.phar vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php vendor/phpstan/phpstan/bootstrap.php
phpstan-command: ../../../phpstan.phar analyze src --level=max -c ../efabrica-phpstan-latte.neon
baseline-file: efabrica-phpstan-latte-baseline.neon
- php-version: 8.2
repo: bladestan/bladestan
ref: f1dedaeb283718cf78ac02ba4d013d3a3b86eda1
setup: |
cp ../bladestan-composer.lock composer.lock
composer install
cp ../../../phpstan.phar vendor/phpstan/phpstan/phpstan.phar
cp ../../../phpstan vendor/phpstan/phpstan/phpstan
cp ../../../bootstrap.php vendor/phpstan/phpstan/bootstrap.php
phpstan-command: ../../../phpstan.phar analyse -c ../bladestan.neon
baseline-file: bladestan-baseline.neon
# - php-version: 8.2
# repo: reactphp/promise
# ref: 7053e3ca49a9a8225f081c8f67f785f80cb4d82e
# setup: |
# composer install
# phpstan-command: ../../../phpstan.phar analyse
# baseline-file: react-promise-baseline.neon
# - php-version: 8.2
# repo: WordPress/WordPress-Coding-Standards
# ref: 5f0c8a7ebdde0314ea5e30f76375a10c7d6f3910
# setup: |
# composer install
# phpstan-command: ../../../phpstan.phar analyse -c ../wp-cs.neon
# baseline-file: wp-cs-baseline.neon
- php-version: 8.4
repo: PHPCSStandards/PHP_CodeSniffer
ref: 63e23c0101ea6118428791639c223e8871303228
setup: |
composer install
phpstan-command: ../../../phpstan.phar analyse -c ../phpcs.neon
baseline-file: phpcs-baseline.neon
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: "Checkout"
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
repository: "phpstan/phpstan"
ref: ${{ inputs.ref }}
- name: "Install PHP"
uses: "shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1" # v2
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
ini-file: development
- uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3
- name: "Download phpstan.phar"
uses: Wandalen/wretry.action@e68c23e6309f2871ca8ae4763e7629b9c258e1ea # v3.8.0
with:
action: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with: |
name: phar-file
attempt_limit: 5
attempt_delay: 1000
- name: "Checkout project"
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
repository: "${{ matrix.repo }}"
ref: "${{ matrix.ref }}"
path: e2e/integration/repo
- name: "Setup"
working-directory: e2e/integration/repo
run: "${{ matrix.setup }}"
env:
COMPOSER_NO_SECURITY_BLOCKING: 1
- name: "PHPStan"
working-directory: ${{ matrix.phpstan-cwd || 'e2e/integration/repo' }}
run: "${{ matrix.phpstan-command }}"
- name: "Generate baseline"
if: ${{ failure() }}
working-directory: ${{ matrix.phpstan-cwd || 'e2e/integration/repo' }}
run: "${{ matrix.phpstan-command }} -b ../${{ matrix.baseline-file }}"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ failure() }}
with:
name: baselines-${{ matrix.baseline-file }}
path: "e2e/integration/${{ matrix.baseline-file }}"
integration-update-baseline:
name: "Integration - Update baselines"
runs-on: "ubuntu-latest"
needs: integration-run-phpstan
if: "failure() && github.repository_owner == 'phpstan' && inputs.ref == 'refs/heads/2.2.x'"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: "Checkout"
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
repository: "phpstan/phpstan"
ref: ${{ inputs.ref }}
token: ${{ secrets.phpstan-bot-token }}
- name: "Download baselines"
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: baselines-*
merge-multiple: true
path: "e2e/integration"
- name: "Create Pull Request"
id: create-pr
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
with:
token: ${{ secrets.phpstan-bot-token }}
branch: "create-pull-request/baselines-2.2.x"
delete-branch: true
title: "Update baselines for ${{ inputs.ref }}"
committer: "phpstan-bot <ondrej+phpstanbot@mirtes.cz>"
commit-message: "Update baselines"
pmmp-tests:
name: "PMMP Tests"
runs-on: "ubuntu-latest"
timeout-minutes: 30
needs: check-phar-checksum
if: "needs.check-phar-checksum.outputs.checksum-result == 'different'"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: "Checkout"
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
repository: "phpstan/phpstan"
ref: ${{ inputs.ref }}
- name: Setup PHP
uses: pmmp/setup-php-action@3c38c259834f945351a662392836d90eb08abff0 # 3.2.0
with:
php-version: 8.4
install-path: "./bin"
pm-version-major: "5"
- uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3
- name: "Download phpstan.phar"
uses: Wandalen/wretry.action@e68c23e6309f2871ca8ae4763e7629b9c258e1ea # v3.8.0
with:
action: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with: |
name: phar-file
attempt_limit: 5
attempt_delay: 1000
- name: "Checkout PMMP"
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
repository: "pmmp/PocketMine-MP"
ref: 5.37.3
path: e2e/integration/repo
- name: "Install dependencies"
uses: "ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520" # v3
with:
working-directory: "e2e/integration/repo"
- name: "PHPStan"
working-directory: "e2e/integration/repo"
run: ../../../phpstan.phar analyse -c ../pocketmine-ng.neon --memory-limit=2G
- name: "Generate baseline"
if: ${{ failure() }}
working-directory: "e2e/integration/repo"
run: ../../../phpstan.phar analyse -c ../pocketmine-ng.neon --memory-limit=2G -b ../pocketmine-ng-baseline.neon
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ failure() }}
with:
name: pocketmine-ng-baseline.neon
path: e2e/integration/pocketmine-ng-baseline.neon