diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-08-18 14:29:13 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-08-18 14:29:13 +0200 |
| commit | a31f4da97a17ec1c1c74a3469c0fc2791c39b2e7 (patch) | |
| tree | c47ade4dbad522a5cdcc068f885a664638d2f54f | |
| parent | 026cc2215e374e5c6433cababfc6e282dada4842 (diff) | |
exclude changes in ilias referrer files from phpstan, fixes #5821
Closes #5821
Merge request studip/studip!4437
| -rw-r--r-- | .gitlab-ci.yml | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 12ac66a..3731020 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -268,10 +268,10 @@ phpstan: PHPSTAN_CODE_QUALITY_REPORT: $REPORT_DIR/phpstan-codequality.json interruptible: true cache: - - <<: *composer-cache - - key: "$CI_JOB_NAME_SLUG" - paths: - - $CACHE_LOCATION + - <<: *composer-cache + - key: "$CI_JOB_NAME_SLUG" + paths: + - $CACHE_LOCATION before_script: - !reference [.scripts, mkdir-caches] - !reference [.scripts, mkdir-reports] @@ -287,12 +287,14 @@ phpstan: EOF script: - - composer/bin/phpstan analyse - $(get_changed_files '*.php') - --memory-limit=1G - --no-progress - --level=$PHPSTAN_LEVEL - --error-format=gitlab > $PHPSTAN_CODE_QUALITY_REPORT + - RELEVANT=$(get_changed_files '*.php' | grep -vE '^lib/ilias_interface/studip_referrer_.*\.php$' || true) + - | + if [ -z "$RELEVANT" ]; then + echo "No relevant files changed - skipping PHPStan" + exit 0 + fi + + composer/bin/phpstan analyse $RELEVANT --memory-limit=1G --no-progress --level=$PHPSTAN_LEVEL --error-format=gitlab > $PHPSTAN_CODE_QUALITY_REPORT after_script: - rm phpstan.neon artifacts: |
