diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a2a5ad9560075ff07cdcdcb4b507151c70e5e56f..8b45479ae6e3edb4feb5029f35fbbdad85324f14 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,54 +1,37 @@ -cache: - key: "$CI_COMMIT_REF_NAME-$CI_JOB_NAME" - paths: - - $HOME/.composer/cache - - vendor/ - -variables: - COMPOSER_NO_INTERACTION: "1" - COMPOSER_ALLOW_SUPERUSER: "1" - S6_TARGET: none - DEBIAN_FRONTEND: noninteractive +.defaults: &defaults + tags: [ docker ] + image: isdevtools.irstea.fr/poleis/php-analysis:7.1 phpunit: - stage: test - tags: [docker] - image: isdevtools.irstea.fr/poleis/php-apache2:stretch-7.1 + <<: *defaults before_script: - - phpenmod pdo_sqlite curl - - composer update --prefer-dist --no-progress --ansi --no-suggest --prefer-stable + - composer install --prefer-dist --no-progress --no-suggest script: - vendor/bin/phpunit - -.static-analysis: &static-analysis - stage: test - tags: [docker] - image: isdevtools.irstea.fr/poleis/php-analysis:7.1 + cache: + key: "$CI_COMMIT_REF_NAME" + paths: + - vendor phploc: - <<: *static-analysis - script: - - phploc --exclude=vendor . + <<: *defaults + script: phploc --exclude=vendor . lint: - <<: *static-analysis - script: - - parallel-lint -j $(nproc) --exclude vendor . + <<: *defaults + script: parallel-lint -j $(nproc) --exclude vendor . phpcs: - <<: *static-analysis - script: - - phpcs --colors --parallel=$(nproc) . + <<: *defaults + script: phpcs --colors --parallel=$(nproc) . allow_failure: true phpcpd: - <<: *static-analysis - script: - - phpcpd --exclude=vendor --fuzzy . + <<: *defaults + script: phpcpd --exclude=vendor --fuzzy . phpmd: - <<: *static-analysis - script: - - phpmd . text ./phpmd.xml --suffixes=php + <<: *defaults + script: phpmd . text ./phpmd.xml --suffixes=php allow_failure: true