@@ -50,10 +50,13 @@ jobs:
5050 tools : pecl
5151 extensions : ds,mbstring
5252 ini-file : development
53- ini-values : memory_limit=2G
53+ ini-values : memory_limit=-1
5454
5555 - uses : " ramsey/composer-install@v3"
5656
57+ - name : " Check PHP configuration"
58+ run : " vendor/bin/phpunit --check-php-configuration"
59+
5760 - name : " Tests"
5861 run : " make tests"
5962
@@ -79,10 +82,13 @@ jobs:
7982 tools : pecl
8083 extensions : ds,mbstring
8184 ini-file : development
82- ini-values : memory_limit=1G
85+ ini-values : memory_limit=-1
8386
8487 - uses : " ramsey/composer-install@v3"
8588
89+ - name : " Check PHP configuration"
90+ run : " vendor/bin/phpunit --check-php-configuration"
91+
8692 - name : " Tests"
8793 run : " make tests-integration"
8894
@@ -137,10 +143,13 @@ jobs:
137143 tools : pecl
138144 extensions : ds,mbstring
139145 ini-file : development
140- ini-values : memory_limit=1G
146+ ini-values : memory_limit=-1
141147
142148 - uses : " ramsey/composer-install@v3"
143149
150+ - name : " Check PHP configuration"
151+ run : " vendor/bin/phpunit --check-php-configuration"
152+
144153 - name : " Tests"
145154 run : " ${{ matrix.script }}"
146155
@@ -182,34 +191,87 @@ jobs:
182191 shell : bash
183192 run : " composer require --dev phpunit/phpunit:^9.6 brianium/paratest:^6.5 symfony/console:^5.4 symfony/process:^5.4 --update-with-dependencies --ignore-platform-reqs --working-dir=tests"
184193
185- - name : " Change to simple-downgrade PHP version"
186- if : matrix.php-version == '7.4' || matrix.php-version == '8.0' || matrix.php-version == '8.1'
187- uses : " shivammathur/setup-php@v2"
194+ - uses : ./.github/actions/downgrade-code
188195 with :
189- coverage : " none"
190- php-version : " 8.4"
191- tools : pecl
192- extensions : ds,mbstring
193- ini-file : development
194- ini-values : memory_limit=2G
196+ php-version : " ${{ matrix.php-version }}"
195197
196- - name : " Transform source code"
197- shell : bash
198- run : |
199- composer install --no-interaction --no-progress --working-dir=compiler
200- ./compiler/vendor/bin/simple-downgrade downgrade -c build/downgrade.php ${{ matrix.php-version }}
201- composer dump
198+ - name : " Tests"
199+ run : " make tests"
202200
203- - name : " Re-store PHP version"
204- if : matrix.php-version == '7.4' || matrix.php-version == '8.0' || matrix.php-version == '8.1'
205- uses : " shivammathur/setup-php@v2"
201+ mutation-testing :
202+ name : " Mutation Testing"
203+ runs-on : " ubuntu-latest"
204+ needs : ["tests"]
205+ if : github.event_name == 'pull_request'
206+
207+ strategy :
208+ fail-fast : false
209+ matrix :
210+ php-version :
211+ - " 8.2"
212+ - " 8.3"
213+ - " 8.4"
214+ operating-system : [ubuntu-latest]
215+
216+ steps :
217+ - name : " Checkout"
218+ uses : actions/checkout@v5
219+
220+ - name : " Checkout build-infection"
221+ uses : actions/checkout@v5
222+ with :
223+ repository : " phpstan/build-infection"
224+ path : " build-infection"
225+ ref : " 1.x"
226+
227+ - uses : ./build-infection/.github/actions/setup-php
206228 with :
207- coverage : " none"
208229 php-version : " ${{ matrix.php-version }}"
209- tools : pecl
210230 extensions : ds,mbstring
211- ini-file : development
212- ini-values : memory_limit=2G
213231
214- - name : " Tests"
215- run : " make tests"
232+ - name : " Install dependencies"
233+ run : " composer install --no-interaction --no-progress"
234+
235+ - name : " Install build-infection dependencies"
236+ working-directory : " build-infection"
237+ run : " composer install --no-interaction --no-progress"
238+
239+ - name : " Configure infection"
240+ run : |
241+ php build-infection/bin/infection-config.php \
242+ --source-directory='build/PHPStan/Build' \
243+ > infection.json5
244+ cat infection.json5 | jq
245+
246+ - name : " Determine default branch"
247+ id : default-branch
248+ run : |
249+ echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> $GITHUB_OUTPUT
250+
251+ - name : " Restore result cache"
252+ uses : actions/cache/restore@v4
253+ with :
254+ path : ./tmp
255+ key : " result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"
256+ restore-keys : |
257+ result-cache-v1-${{ matrix.php-version }}-
258+
259+ - name : " Run infection"
260+ run : |
261+ git fetch --depth=1 origin ${{ steps.default-branch.outputs.name }}
262+ infection \
263+ --git-diff-base=origin/${{ steps.default-branch.outputs.name }} \
264+ --git-diff-lines \
265+ --ignore-msi-with-no-mutations \
266+ --min-msi=100 \
267+ --min-covered-msi=100 \
268+ --log-verbosity=all \
269+ --debug \
270+ --logger-text=php://stdout
271+
272+ - name : " Save result cache"
273+ uses : actions/cache/save@v4
274+ if : ${{ !cancelled() }}
275+ with :
276+ path : ./tmp
277+ key : " result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"
0 commit comments