diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 88a91a8..d5de906 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -95,30 +95,37 @@ phpcs: stage: lint variables: PHPCS_REPORT: phpcs-report.txt + PHPCS_JUNIT: phpcs-junit.xml script: - - vendor/bin/phpcs -q --report=full --standard=phpcs.xml --extensions=php --ignore=vendor/*,storage/*,bootstrap/*,node_modules/*,.intellipest/* . > "$PHPCS_REPORT" 2>&1; status=$? + - vendor/bin/phpcs -q --report=full --report-junit="$PHPCS_JUNIT" --standard=phpcs.xml --extensions=php --ignore=vendor/*,storage/*,bootstrap/*,node_modules/*,.intellipest/* . > "$PHPCS_REPORT" 2>&1; status=$? - cat "$PHPCS_REPORT" - exit $status artifacts: when: always expose_as: "phpcs report" paths: - - phpcs-report.txt + - "$PHPCS_REPORT" + - "$PHPCS_JUNIT" + reports: + junit: "$PHPCS_JUNIT" phpstan: <<: *php-base stage: lint variables: PHPSTAN_REPORT: phpstan-report.txt + PHPSTAN_JUNIT: phpstan-junit.xml script: - - composer run-script analyse -- --no-progress > "$PHPSTAN_REPORT" 2>&1; status=$? - - cat "$PHPSTAN_REPORT" + - vendor/bin/phpstan analyse --error-format=junit --no-progress > "$PHPSTAN_JUNIT" 2> "$PHPSTAN_REPORT"; status=$? + - if [ ! -s "$PHPSTAN_JUNIT" ] || ! head -n 1 "$PHPSTAN_JUNIT" | grep -q '^<'; then rm -f "$PHPSTAN_JUNIT"; fi - exit $status artifacts: when: always expose_as: "phpstan report" paths: - - phpstan-report.txt + - "$PHPSTAN_JUNIT" + reports: + junit: "$PHPSTAN_JUNIT" # --------------------------------------------------------- # TESTS