diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1fd7b24a..c6cc1486 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: + - validate - test - - deploy + - package before_script: - bash ci/docker_install.sh > /dev/null @@ -8,34 +9,61 @@ before_script: - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" - php composer-setup.php - php -r "unlink('composer-setup.php');" - - php composer.phar update -test:7.1: +validate:7.1: image: php:7.1 - stage: test + stage: validate script: - - composer install - - cd Tests - - phpunit - - cd ../../ + - php composer.phar update --no-dev + - php composer.phar install --no-dev - bash ci/php_lint.sh ./ -test:7.0: +validate:7.0: image: php:7.0 - stage: test + stage: validate script: + - php composer.phar update --no-dev + - php composer.phar install --no-dev - bash ci/php_lint.sh ./ -test:5.5: +validate:5.6: + image: php:5.6 + stage: validate + script: + - php composer.phar update --no-dev + - php composer.phar install --no-dev + - bash ci/php_lint.sh ./ + +validate:5.5: image: php:5.5 - stage: test + stage: validate script: + - php composer.phar update --no-dev + - php composer.phar install --no-dev - bash ci/php_lint.sh ./ -deploy: +test:7.1: + image: php:7.1 + stage: test + script: + - php composer.phar update + - php composer.phar install + - cd Tests + - phpunit + +test:7.0: + image: php:7.0 + stage: test + script: + - php composer.phar update + - php composer.phar install + - cd Tests + - phpunit + +package: image: tetraweb/php when: manual - stage: deploy + stage: package script: - apt-get update - apt-get install zip unzip diff --git a/ci/php_lint.sh b/ci/php_lint.sh index 1e0c3ad1..8c58e1aa 100644 --- a/ci/php_lint.sh +++ b/ci/php_lint.sh @@ -12,7 +12,7 @@ while test $# -gt 0; do continue fi - for file in `find $current -type f -not -path "*vendor/*" -name "*.php"` ; do + for file in `find $current -type f -not -path "*vendor/*" -not -path "*api/*" -name "*.php"` ; do RESULTS=`php -l $file` echo $RESULTS