From: Dan Untenzu Date: Thu, 26 Jan 2017 10:15:59 +0000 (+0100) Subject: [FEATURE] Add Gitlab CI X-Git-Tag: 3.0.0~32 X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/commitdiff_plain/9d9faa60955615f8bd9cf3cf9fc04dfb69c6a4db?ds=sidebyside;hp=--cc [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. --- 9d9faa60955615f8bd9cf3cf9fc04dfb69c6a4db 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 .