diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 66c2f9f..464175a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,8 @@ before_script: # Install dependencies -- bash CI/docker_install.sh > /dev/null +- set -xe +- apt-get update -yqq +- apt-get install git zip inzip -yqq stages: - build @@ -22,7 +24,7 @@ test:7.1: stage: test image: php:7.1 script: - - vendor/bin/phpunit -c test/phpunit.xml --coverage-text + - vendor/bin/phpunit -c test/phpunit.xml cache: key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME" paths: @@ -32,7 +34,7 @@ test:7.2: stage: test image: php:7.2 script: - - vendor/bin/phpunit -c test/phpunit.xml --coverage-text + - vendor/bin/phpunit -c test/phpunit.xml cache: key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME" paths: @@ -42,6 +44,18 @@ test:7.3: stage: test image: php:7.3 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 cache: key: "$CI_BUILD_REF_$CI_BUILD_REF_NAME" @@ -54,7 +68,9 @@ release: only: - master 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: name: "${CI_BUILD_NAME}_${CI_BUILD_REF_NAME}" paths: diff --git a/CI/docker_install.sh b/CI/docker_install.sh deleted file mode 100644 index 7bfe123..0000000 --- a/CI/docker_install.sh +++ /dev/null @@ -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 \ No newline at end of file