-
-
Notifications
You must be signed in to change notification settings - Fork 864
280 lines (268 loc) · 12.1 KB
/
integration-tests.yml
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
# 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
jobs:
check-phar-checksum:
name: "Check PHAR checksum"
runs-on: "ubuntu-latest"
outputs:
checksum-result: ${{ steps.checksum-difference.outputs.result }}
steps:
- name: "Checkout"
uses: actions/checkout@v3
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 "::set-output name=result::different
else
echo "::set-output name=result::same
fi
integration-tests:
name: "Integration Tests"
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.1
script: |
git clone https://github.com/rectorphp/rector-src.git e2e/integration/repo
cd e2e/integration/repo
git checkout 71b1142ee41eceef21d9c3d3a1bf5bc4f67ad9d2
cp ../rector-composer.lock composer.lock
composer install
../../../phpstan.phar analyse -c ../rector.neon
- php-version: 8.1
script: |
git clone https://github.com/rectorphp/rector-src.git e2e/integration/repo
cd e2e/integration/repo
git checkout 71b1142ee41eceef21d9c3d3a1bf5bc4f67ad9d2
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/paratest tests
- php-version: 8.1
script: |
git clone https://github.com/rectorphp/rector-src.git e2e/integration/repo
cd e2e/integration/repo
git checkout 71b1142ee41eceef21d9c3d3a1bf5bc4f67ad9d2
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/paratest rules-tests
- php-version: 8.1
script: |
git clone https://github.com/rectorphp/rector-src.git e2e/integration/repo
cd e2e/integration/repo
git checkout 71b1142ee41eceef21d9c3d3a1bf5bc4f67ad9d2
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/paratest packages-tests
- php-version: 8.0
script: |
git clone https://github.com/sebastianbergmann/phpunit.git -b 9.5.12 --depth 1 e2e/integration/repo
cd e2e/integration/repo
export COMPOSER_ROOT_VERSION=9.5.12
composer install
../../../phpstan.phar analyse -l 8 -c ../phpunit.neon src tests
- php-version: 8.0
script: |
git clone https://github.com/pmmp/PocketMine-MP.git e2e/integration/repo
cd e2e/integration/repo
git checkout e0b07ff3087b652407439a29c941f3b66ca92c86
composer install --ignore-platform-reqs
../../../phpstan.phar analyse -c ../pocketmine.neon --memory-limit=2G
- php-version: 8.0
script: |
git clone https://github.com/laravel/framework.git e2e/integration/repo
cd e2e/integration/repo
git checkout ceadf6ea68c5ef316abfc618879f2cf9290e45b3
composer install
../../../phpstan.phar analyse
- php-version: 8.1
script: |
git clone https://github.com/Roave/BetterReflection.git e2e/integration/repo
cd e2e/integration/repo
git checkout 50970c323d45c6b69d20eb620e03980374aac3dd
composer install
../../../phpstan.phar
- php-version: 8.1
script: |
git clone https://github.com/composer/composer.git e2e/integration/repo
cd e2e/integration/repo
git checkout 8ff237afb61b8766efa576b8ae1cc8560c8aed96
composer install
composer config platform --unset && composer update
vendor/bin/simple-phpunit --filter NO_TEST_JUST_AUTOLOAD_THANKS
../../../phpstan.phar analyse -c ../composer.neon
- php-version: 8.1
script: |
git clone https://github.com/nextras/orm.git e2e/integration/repo
cd e2e/integration/repo
git checkout 4edfc4957494ec272899a8916f3f245c59c86d05
composer install
../../../phpstan.phar analyse -c ../nextras.neon
- php-version: 8.1
script: |
git clone https://github.com/slevomat/coding-standard.git e2e/integration/repo
cd e2e/integration/repo
git checkout 8c49f8e6e4e3661ee6e568a06676146475f73430
composer install
../../../phpstan.phar analyse -c ../slevomat-cs.neon -l 7 SlevomatCodingStandard
../../../phpstan.phar analyse -c build/PHPStan/phpstan.tests.neon -l 7 tests
- php-version: 8.1
script: |
git clone https://github.com/ondrejmirtes/orocrm-phpstan-bugreport.git e2e/integration/repo
cd e2e/integration/repo
git checkout 0d429b658a6e7baff863b6f23f5e6fa35c88d6e7
composer install
../../../phpstan
- php-version: 8.1
script: |
git clone https://github.com/ondrejmirtes/phpstan-magento-testcase.git e2e/integration/repo
cd e2e/integration/repo
git checkout f5d8c215569fe5dd22f7236795a353002c0ae58a
composer install
../../../phpstan analyse -c ../magento-testcase.neon
- php-version: 8.1
script: |
git clone https://github.com/symplify/symplify.git e2e/integration/repo
cd e2e/integration/repo
git checkout 92e9b42fba42e75acf5ab89a4dd690340632e352
cp ../symplify-composer.lock composer.lock
composer install
../../../phpstan analyse -c ../symplify.neon
- php-version: 8.1
script: |
git clone https://github.com/symplify/symplify.git e2e/integration/repo
cd e2e/integration/repo
git checkout 92e9b42fba42e75acf5ab89a4dd690340632e352
cp ../symplify-composer.lock composer.lock
composer install
vendor/bin/phpunit
- php-version: 8.1
script: |
git clone https://github.com/nunomaduro/larastan.git e2e/integration/repo
cd e2e/integration/repo
git checkout 32ad25904dc8fbfdae4d4e431a27ba3bad2979cc
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.phar analyse -c ../larastan.neon
composer run-script test:unit
- php-version: 7.4
script: |
git clone https://github.com/bitExpert/phpstan-magento.git e2e/integration/repo
cd e2e/integration/repo
git checkout f845cd4dbdc49d2e005ec2646176ddfcf7d55d38
composer install
../../../phpstan.phar analyse -c ../magento.neon
- php-version: 8.1
script: |
git clone https://github.com/PrestaShop/PrestaShop.git -b 8.0.0 --depth 1 e2e/integration/repo
cd e2e/integration/repo
composer install
../../../phpstan.phar analyse -c ../prestashop.neon
- php-version: 8.1
script: |
git clone https://github.com/doctrine/orm.git -b 2.13.1 --depth 1 e2e/integration/repo
cd e2e/integration/repo
composer install
../../../phpstan.phar analyse -c ../doctrine-orm.neon
- php-version: 8.1
script: |
git clone https://github.com/doctrine/collections.git -b 1.8.0 --depth 1 e2e/integration/repo
cd e2e/integration/repo
composer install
../../../phpstan.phar analyse -c ../doctrine-collections.neon
- php-version: 8.1
script: |
git clone https://github.com/doctrine/collections.git -b 2.0.1 --depth 1 e2e/integration/repo
cd e2e/integration/repo
composer install
../../../phpstan.phar analyse -c ../doctrine-collections.neon
- php-version: 8.1
script: |
git clone https://github.com/doctrine/dbal.git -b 3.4.3 --depth 1 e2e/integration/repo
cd e2e/integration/repo
composer install
../../../phpstan.phar analyse -c ../doctrine-dbal.neon
- php-version: 8.1
script: |
git clone https://github.com/ondrejmirtes/common.git e2e/integration/repo
cd e2e/integration/repo
git checkout 9a63097e0aac554a37962f5249d9c5f2ba458819
composer install
../../../phpstan.phar
- php-version: 8.1
script: |
git clone https://github.com/doctrine/persistence.git -b 3.0.3 --depth 1 e2e/integration/repo
cd e2e/integration/repo
composer install
../../../phpstan.phar analyse -c ../doctrine-persistence.neon
- php-version: 8.1
script: |
git clone https://github.com/shipmonk-rnd/phpstan-rules.git -b 1.1.1 --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
../../../phpstan.phar && vendor/bin/phpunit tests
- php-version: 8.1
script: |
git clone https://git.drupalcode.org/project/drupal.git -b 10.0.0 --depth 1 e2e/integration/repo
cd e2e/integration/repo
composer install
../../../phpstan.phar analyse -c ../drupal.neon
- php-version: 8.1
script: |
git clone https://github.com/webmozarts/assert.git -b 1.11.0 --depth 1 e2e/integration/repo
cd e2e/integration/repo
composer install
../../../phpstan.phar analyse -l 9 tests/static-analysis -c ../webmozart.neon
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
repository: "phpstan/phpstan"
ref: ${{ inputs.ref }}
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
- name: "Install dependencies"
run: "composer update --no-interaction --no-progress"
- name: "Download phpstan.phar"
uses: actions/download-artifact@v3
with:
name: phar-file
- name: "Tests"
run: "${{ matrix.script }}"