From 9d9faa60955615f8bd9cf3cf9fc04dfb69c6a4db Mon Sep 17 00:00:00 2001 From: Dan Untenzu Date: Thu, 26 Jan 2017 11:15:59 +0100 Subject: [PATCH 1/1] [FEATURE] Add Gitlab CI Make use of the fantastic Gitlab CI to run some tests automatically after each push. First test: test for PHP errors in different versions. --- .gitignore | 1 + .gitlab-ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitignore b/.gitignore index ce9a748..b83b750 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ lib/config.local.php lib/tos.local.txt var-* *._* +/vendor \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..b2cf87e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,39 @@ +# Select docker image from https://hub.docker.com/_/php/ +image: php:7.1 + +# Select what we should cache +cache: + paths: + - vendor/ + +before_script: + # Install git, the docker php image doesn't have it installed by default + - apt-get update -yqq + - apt-get install git -yqq + - apt-get install zip -yqq + # Enable necessary php extensions + - docker-php-ext-enable curl && docker-php-ext-enable json && docker-php-ext-enable zip && docker-php-ext-enable mbstring && docker-php-ext-enable gd && docker-php-ext-enable pdo_mysql + # Install composer + - curl -sS https://getcomposer.org/installer | php + # Create composer.json file manually, since this is a project without any non-dev dependencies yet + - php composer.phar require --dev jakub-onderka/php-parallel-lint + # Install all project dependencies + - php composer.phar install + +# Run tests +## Default test with PHP7.1 +test_app_php71: + script: + - ./vendor/bin/parallel-lint --exclude vendor . + +# Run same tests with PHP7.0 +test_app_php70: + image: php:7.0 + script: + - ./vendor/bin/parallel-lint --exclude vendor . + +# Run same tests with PHP5.6 +test_app_php56: + image: php:5.6 + script: + - ./vendor/bin/parallel-lint --exclude vendor . -- 2.34.1