.gitlab-ci.yml 1.43 KB
Newer Older
Jan Kuchař's avatar
Jan Kuchař 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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
image: grifart/php7.2-with-gulp-and-all-php-modules


# STAGES

stages:
- build
- test



# BUILDS

# composer

.build-composer-template: &build-composer-template
  stage: build

  artifacts:
    expire_in: 2 hours
    name: "${CI_BUILD_REF_NAME}_${CI_BUILD_NAME}"
    paths:
    - vendor

build.composer.dev:
  <<: *build-composer-template

  script:
  - composer install --no-interaction --ansi

build.composer:
  <<: *build-composer-template

  script:
  - composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader --ansi




# TESTS


# php lint

test.php-syntax-check:
  stage: test

  script:
  - composer global require jakub-onderka/php-console-highlighter jakub-onderka/php-parallel-lint
  - parallel-lint src


# php stan

test.phpstan:
  stage: test

  dependencies:
  - build.composer.dev

  script:
  - composer run phpstan


# tests

.test.tests: &test-tests
  stage: test

  dependencies:
  - build.composer.dev

  script:
  - composer run test

  artifacts:
    expire_in: 15 minutes
    paths:
    - log
    - src # can contain assertion diffs
    when: on_failure

test.tests.php71:
  <<: *test-tests
  image: grifart/php7.1-with-gulp-and-all-php-modules

test.tests.php71.oldDeps:
  <<: *test-tests
  before_script:
  - composer update --prefer-lowest --no-interaction --ansi
  image: grifart/php7.1-with-gulp-and-all-php-modules


test.tests.php72:
  <<: *test-tests
  image: grifart/php7.2-with-gulp-and-all-php-modules