Loading .gitlab-ci.yml +10 −1 Changes for .gitlab-ci.yml: 10 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -375,13 +375,22 @@ default: # Output a copy in junit. - php vendor/bin/phpstan -vvv analyze --configuration=./core/phpstan.neon.dist --error-format=gitlab > $CI_PROJECT_DIR/phpstan-quality-report.json || EXIT_CODE=$? - php vendor/bin/phpstan -vvv analyze --configuration=./core/phpstan.neon.dist --no-progress --error-format=junit > $CI_PROJECT_DIR/phpstan-junit.xml || true # When the PHPStan scan fails, output a human readable copy of the errors, # and regenerate a full baseline. # In order to regenerate a baseline artifact that can be copied and pasted # to a MR branch, we first need to void the current baseline file, then # run PHPStan with the --generate-baseline option, and finally edit the # generated file to convert absolute paths into relative ones. - | if [ -n "$EXIT_CODE" ]; then # Output a copy in plain text for human logs. php vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist --no-progress || true # Generate a new baseline. echo "Generating an PHPStan baseline file (available as job artifact)." cp $CI_PROJECT_DIR/.gitlab-ci/scripts/.empty-phpstan-baseline.php ./core/.phpstan-baseline.php php vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist --no-progress --generate-baseline=$CI_PROJECT_DIR/core/.phpstan-baseline.php || true sed -i "s/ '\\/\\/build\\/core/ '/g" $CI_PROJECT_DIR/core/.phpstan-baseline.php sed -i "s/ '\\/\\/build/ '\\/../g" $CI_PROJECT_DIR/core/.phpstan-baseline.php exit $EXIT_CODE fi Loading @@ -392,7 +401,7 @@ default: codequality: phpstan-quality-report.json junit: phpstan-junit.xml paths: - core/.phpstan-baseline.php - $CI_PROJECT_DIR/core/.phpstan-baseline.php '🧹 PHP Coding standards (PHPCS)': <<: [ *default-job-settings-lint ] Loading .gitlab-ci/scripts/.empty-phpstan-baseline.php 0 → 100644 +3 −0 Changes for .gitlab-ci/scripts/.empty-phpstan-baseline.php: 3 added lines, 0 removed lines. Original line number Diff line number Diff line <?php return []; Loading
.gitlab-ci.yml +10 −1 Changes for .gitlab-ci.yml: 10 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -375,13 +375,22 @@ default: # Output a copy in junit. - php vendor/bin/phpstan -vvv analyze --configuration=./core/phpstan.neon.dist --error-format=gitlab > $CI_PROJECT_DIR/phpstan-quality-report.json || EXIT_CODE=$? - php vendor/bin/phpstan -vvv analyze --configuration=./core/phpstan.neon.dist --no-progress --error-format=junit > $CI_PROJECT_DIR/phpstan-junit.xml || true # When the PHPStan scan fails, output a human readable copy of the errors, # and regenerate a full baseline. # In order to regenerate a baseline artifact that can be copied and pasted # to a MR branch, we first need to void the current baseline file, then # run PHPStan with the --generate-baseline option, and finally edit the # generated file to convert absolute paths into relative ones. - | if [ -n "$EXIT_CODE" ]; then # Output a copy in plain text for human logs. php vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist --no-progress || true # Generate a new baseline. echo "Generating an PHPStan baseline file (available as job artifact)." cp $CI_PROJECT_DIR/.gitlab-ci/scripts/.empty-phpstan-baseline.php ./core/.phpstan-baseline.php php vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist --no-progress --generate-baseline=$CI_PROJECT_DIR/core/.phpstan-baseline.php || true sed -i "s/ '\\/\\/build\\/core/ '/g" $CI_PROJECT_DIR/core/.phpstan-baseline.php sed -i "s/ '\\/\\/build/ '\\/../g" $CI_PROJECT_DIR/core/.phpstan-baseline.php exit $EXIT_CODE fi Loading @@ -392,7 +401,7 @@ default: codequality: phpstan-quality-report.json junit: phpstan-junit.xml paths: - core/.phpstan-baseline.php - $CI_PROJECT_DIR/core/.phpstan-baseline.php '🧹 PHP Coding standards (PHPCS)': <<: [ *default-job-settings-lint ] Loading
.gitlab-ci/scripts/.empty-phpstan-baseline.php 0 → 100644 +3 −0 Changes for .gitlab-ci/scripts/.empty-phpstan-baseline.php: 3 added lines, 0 removed lines. Original line number Diff line number Diff line <?php return [];