diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 93913b9bfb3a1853da48cc1059841947b237376d..4f5e36d199c46c1102ffc85030cc344492817b22 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,29 +2,33 @@ stages: - test - deploy -.test: &test +.test: stage: test tags: [docker] image: gitlab-registry.irstea.fr/pole-is/docker/php:buster-${CI_JOB_NAME} variables: COMPOSER_CACHE_DIR: "${CI_PROJECT_DIR}/.composer-cache" + COMPOSER_OPTS: "" before_script: - php -v - composer -V script: - - composer install + - composer install $COMPOSER_OPTS - php -l src/*.php - vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no + - vendor/bin/phpunit cache: key: "composer-cache-${CI_COMMIT_REF_NAME}" paths: - "${COMPOSER_CACHE_DIR}" "7.1": - <<: *test + extends: .test + variables: + COMPOSER_OPTS: "--prefer-lowest --prefer-stable" "7.3": - <<: *test + extends: .test deploy: stage: deploy