Browse Source

CI: Improve Infection setup (#7913)

Greg Korba 11 months ago
parent
commit
3159e49534
2 changed files with 5 additions and 1 deletions
  1. 2 1
      .github/workflows/ci.yml
  2. 3 0
      dev-tools/build.sh

+ 2 - 1
.github/workflows/ci.yml

@@ -213,7 +213,8 @@ jobs:
         run: vendor/bin/paraunit coverage --testsuite unit --pass-through=--exclude-group=covers-nothing --clover=build/logs/clover.xml
 
       - name: Run mutation tests (Infection)
-        if: matrix.run-mutation-tests == 'yes'
+        # Run only on pull requests because we run mutations tests only for diff between branches
+        if: github.event_name == 'pull_request' && matrix.run-mutation-tests == 'yes'
         env:
           FAST_LINT_TEST_CASES: 1
         run: |

+ 3 - 0
dev-tools/build.sh

@@ -4,6 +4,9 @@ set -eu
 # ensure that deps will work on lowest supported PHP version
 composer config platform.php 7.4
 
+# Infection is not compatible with 7.4, and basically not needed in PHAR
+composer remove --dev infection/infection --no-update
+
 # install package deps without dev-deps / remove already installed dev-deps
 # box can ignore dev-deps, but dev-deps, when installed, may lower version of prod-deps
 composer update --optimize-autoloader --no-interaction --no-progress --no-scripts --no-dev