Implemented changes to gitlab-ci.yml. Fixes #138.

This commit is contained in:
Abel Hoogeveen 2019-02-11 17:13:28 +01:00
parent 5a6b52f93d
commit 959540bba4
No known key found for this signature in database
GPG Key ID: 96C2234920BF4292
2 changed files with 20 additions and 18 deletions

View File

@ -1,6 +1,8 @@
before_script: before_script:
# Install dependencies # Install dependencies
- bash CI/docker_install.sh > /dev/null - set -xe
- apt-get update -yqq
- apt-get install git zip inzip -yqq
stages: stages:
- build - build
@ -22,7 +24,7 @@ test:7.1:
stage: test stage: test
image: php:7.1 image: php:7.1
script: script:
- vendor/bin/phpunit -c test/phpunit.xml --coverage-text - vendor/bin/phpunit -c test/phpunit.xml
cache: cache:
key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME" key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME"
paths: paths:
@ -32,7 +34,7 @@ test:7.2:
stage: test stage: test
image: php:7.2 image: php:7.2
script: script:
- vendor/bin/phpunit -c test/phpunit.xml --coverage-text - vendor/bin/phpunit -c test/phpunit.xml
cache: cache:
key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME" key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME"
paths: paths:
@ -42,6 +44,18 @@ test:7.3:
stage: test stage: test
image: php:7.3 image: php:7.3
script: script:
- vendor/bin/phpunit -c test/phpunit.xml
cache:
key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME"
paths:
- vendor/
test:coverage:
stage: test
image: php:7.2
script:
- pecl install xdebug
- docker-php-ext-enable xdebug
- vendor/bin/phpunit -c test/phpunit.xml --coverage-text - vendor/bin/phpunit -c test/phpunit.xml --coverage-text
cache: cache:
key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME" key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME"
@ -54,7 +68,9 @@ release:
only: only:
- master - master
script: script:
- vendor/bin/phpunit -c test/phpunit.xml --coverage-text - pecl install xdebug
- docker-php-ext-enable xdebug
- vendor/bin/phpunit -c test/phpunit.xml --coverage-text
artifacts: artifacts:
name: "${CI_BUILD_NAME}_${CI_BUILD_REF_NAME}" name: "${CI_BUILD_NAME}_${CI_BUILD_REF_NAME}"
paths: paths:

View File

@ -1,14 +0,0 @@
#!/bin/bash
# We need to install dependencies only for Docker
[[ ! -e /.dockerenv ]] && [[ ! -e /.dockerinit ]] && exit 0
set -xe
# Install git (the php image doesn't have it) which is required by composer
apt-get update -yqq
apt-get install git zip unzip -yqq
# Install xdebug
pecl install xdebug
docker-php-ext-enable xdebug