diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 62d7ee6c9c26ecfe1aab5e2ba49115e2930b23d3..6cdf2d49aa1fa09e484b5cf97cda17a8888bbfde 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,7 @@ stages: - test +variables: + APP_ENV: dev PHPstan: stage: test @@ -7,8 +9,13 @@ PHPstan: before_script: - apk add php-cli composer php-gd php-ctype php-xml php-simplexml php-xmlwriter php-tokenizer php-session php-dom - composer install + - bin/console cache:warmup script: - - vendor/bin/phpstan analyse + - vendor/bin/phpstan analyse --no-progress --error-format gitlab > phpstan.json + artifacts: + when: always + reports: + codequality: phpstan.json PHPCS: stage: test @@ -17,4 +24,7 @@ PHPCS: - apk add php-cli composer php-gd php-ctype php-xml php-simplexml php-xmlwriter php-tokenizer php-session php-dom - composer install script: - - vendor/bin/phpcs \ No newline at end of file + - vendor/bin/phpcs --report=full --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-quality-report.json + artifacts: + reports: + codequality: phpcs-quality-report.json \ No newline at end of file diff --git a/composer.json b/composer.json index f492eaabc34e99f5ea195e0702f94f71d3eadf3a..6effeb4a5b258bf6cf29c8bca7faa7b8c2a52a24 100644 --- a/composer.json +++ b/composer.json @@ -82,6 +82,7 @@ } }, "require-dev": { + "micheh/phpcs-gitlab": "^1.1", "phpstan/phpstan": "^1.9", "phpstan/phpstan-symfony": "^1.2", "squizlabs/php_codesniffer": "^3.7", diff --git a/composer.lock b/composer.lock index dd990989e68b30686393d5a524098fa1cb777743..c7de4dae226fe4ae3faf4cb5626ac4817fce65a9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fe0945aacd276a20b683d8884b3ac51c", + "content-hash": "83e175494e3f4f3852424c438e7da0bc", "packages": [ { "name": "aws/aws-crt-php", @@ -7596,6 +7596,58 @@ } ], "packages-dev": [ + { + "name": "micheh/phpcs-gitlab", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/micheh/phpcs-gitlab.git", + "reference": "fd64e6579d9e30a82abba616fabcb9a2c837c7a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/micheh/phpcs-gitlab/zipball/fd64e6579d9e30a82abba616fabcb9a2c837c7a8", + "reference": "fd64e6579d9e30a82abba616fabcb9a2c837c7a8", + "shasum": "" + }, + "require": { + "ext-json": "*" + }, + "require-dev": { + "phpunit/phpunit": "^8.0 || ^9.0", + "squizlabs/php_codesniffer": "^3.3.1", + "vimeo/psalm": "^4.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Micheh\\PhpCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Michel Hunziker", + "email": "info@michelhunziker.com" + } + ], + "description": "Gitlab Report for PHP_CodeSniffer (display the violations in the Gitlab CI/CD Code Quality Report)", + "keywords": [ + "PHP_CodeSniffer", + "code quality", + "gitlab", + "phpcs", + "report" + ], + "support": { + "issues": "https://github.com/micheh/phpcs-gitlab/issues", + "source": "https://github.com/micheh/phpcs-gitlab/tree/1.1.0" + }, + "time": "2020-12-20T09:39:07+00:00" + }, { "name": "phpstan/phpstan", "version": "1.9.14",