Skip to content
Snippets Groups Projects
Verified Commit f8ceef9b authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

feat: display static analysis in reports

parent 04e6b926
No related branches found
No related tags found
No related merge requests found
variables:
WPDESK_CI_VERSION: "2024.10.14"
WPDESK_CI_VERSION: "2024.10.25"
MYSQL_ROOT_PASSWORD: "mysql"
MYSQL_DATABASE: "wptest"
MYSQL_USER: "mysql"
......
......@@ -10,16 +10,22 @@ phpstan:
script:
- |
if [ -f "vendor/bin/phpstan" ]; then
vendor/bin/phpstan analyse --memory-limit=2G
vendor/bin/phpstan analyse --error-format=gitlab --memory-limit=2G > phpstan-codequality.json
elif [ -f "vendor/wpdesk/wp-wpdesk-composer/director/vendor/bin/phpstan" ]; then
# PHPStan installed by director
vendor/wpdesk/wp-wpdesk-composer/director/vendor/bin/phpstan analyse --memory-limit=2G
vendor/wpdesk/wp-wpdesk-composer/director/vendor/bin/phpstan analyse --error-format=gitlab --memory-limit=2G > phpstan-codequality.json
else
echo "PHPStan not found! Install it with 'composer require --dev wpdesk/phpstan-rules'."
# We will be able to handle custom exit after removing rules.allow_failure part
exit 125
fi
allow_failure: true
artifacts:
paths:
- phpstan-codequality.json
expire_in: 1 week
reports:
codequality: phpstan-codequality.json
rules:
- !reference [.skip-mr, rules]
- exists:
......@@ -32,9 +38,15 @@ phpstan:
phpcs:
extends: .static-analysis
script:
- vendor/bin/phpcs
- vendor/bin/phpcs --report-junit=phpcs-junit.xml --report-full
allow_failure: true
rules:
- !reference [.skip-mr, rules]
- exists:
- phpcs.xml.dist
artifacts:
paths:
- phpcs-junit.xml
expire_in: 1 week
reports:
junit: phpcs-junit.xml
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment