From 2604cd5ada9522ff25e791c78b3eb6dbf006d0c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guillaume=20Perr=C3=A9al?= <guillaume.perreal@irstea.fr>
Date: Thu, 19 Oct 2017 13:55:21 +0200
Subject: [PATCH] CI: simplification de la configuration.

---
 .gitlab-ci.yml | 55 +++++++++++++++++---------------------------------
 1 file changed, 19 insertions(+), 36 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a2a5ad95..8b45479a 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
-- 
GitLab