ci: add junit reports

This commit is contained in:
Jérémy Munsch 2026-09-22 09:39:44 +02:00 • committed by Corentin Huet
parent 173796c5fb
commit b10d855b14

View file

@ -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