diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d98d295..7846ad6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,10 @@ cache: - vendor/ - node_modules/ +stages: + - build + - test + before_script: - apt-get update -yqq - apt-get install -yqq git libzip-dev libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev @@ -18,7 +22,6 @@ before_script: - docker-php-ext-enable xdebug # Install and run Composer - curl -sS https://getcomposer.org/installer | php -- php composer.phar install # Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service # See http://docs.gitlab.com/ce/ci/services/README.html for examples. @@ -33,7 +36,18 @@ variables: # Run our tests # If Xdebug was installed you can generate a coverage report and see code coverage metrics. -test: +build: + stage: build script: - - vendor/bin/phpunit --coverage-text --colors=never - - vendor/bin/codacycoverage clover tmp/code-coverage.xml + - php composer.phar install + +phpmd: + stage: test + script: + - composer run phpmd + +phpcs: + stage: test + script: + - php composer.phar run phpcs + - vendor/bin/codacycoverage clover tmp/code-coverage.xml diff --git a/composer.json b/composer.json index 89eb904..21760ef 100644 --- a/composer.json +++ b/composer.json @@ -32,5 +32,10 @@ "phpunit/phpunit": "^8.1", "codacy/coverage": "^1.4", "phpmd/phpmd": "^2.6" - } + }, + "scripts": { + "phpmd": "phpmd src/ text phpmd", + "phpcs": "phpcs --coverage-text --colors=never", + "test": "composer run phpmd && composer run phpcs" + } } diff --git a/phpmd.xml b/phpmd.xml new file mode 100644 index 0000000..8357783 --- /dev/null +++ b/phpmd.xml @@ -0,0 +1,26 @@ + + + AdminPanel rules + + + + + + + + + + + + + + + + + +