.gitlab-ci.yml 1.34 KB
Newer Older
Guillaume Perréal's avatar
Guillaume Perréal committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
stages:
  - vendor
  - test

.php: &php
  tags:
    - docker
  image: php:${PHP_VERSION}-cli-stretch
  variables:
    COMPOSER_HOME: "$CI_PROJECT_DIR/.composer"
    COMPOSER_NO_INTERACTION: "1"
    COMPOSER_ALLOW_SUPERUSER: "1"
    COMPOSER_INSTALLER_COMMITID: "5eb0614d3fa7130b363698d3dca52c619b463615"
    PHP_VERSION: "7.1"
  before_script:
    - apt-get update -yqq && apt-get install -yqq unzip git-core
    - php -v
    - curl -sSfL https://raw.githubusercontent.com/composer/getcomposer.org/${COMPOSER_INSTALLER_COMMITID}/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
    - composer -V

vendor:
  <<: *php
  stage: vendor
  dependencies: []
  script:
    - composer global require hirak/prestissimo --quiet
    - composer install --no-suggest --no-progress
  artifacts:
    name: "$CI_JOB_NAME"
    paths:
      - vendor
    expire_in: 4 hours
  cache:
    key: "$CI_BUILD_REF_NAME-composer"
    paths:
      - "$COMPOSER_HOME"

.php-test: &php-test
  <<: *php
  stage: test
  dependencies:
    - vendor
  script: composer ${CI_JOB_NAME}

phploc: { <<: *php-test }

test:lint: { <<: *php-test }
test:phpcpd: { <<: *php-test }
test:phpmd: { <<: *php-test }
test:phpstan: { <<: *php-test }
test:phpunit: { <<: *php-test }
test:composer-validate: { <<: *php-test }
test:composer-require: { <<: *php-test }
test:security: { <<: *php-test }