From 83aa81f0c31ae59dac730fd229157fe3b59d8731 Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 27 May 2016 22:32:42 +1000 Subject: [PATCH] Added gitlab runner configuration --- .gitlab-ci.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ ci/docker_install.sh | 18 ++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 ci/docker_install.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..d5257260 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,43 @@ +services: + - centos/mariadb:latest + +variables: + MYSQL_ROOT_PASSWORD: root + MYSQL_USER: user + MYSQL_PASSWORD: password + MYSQL_DATABASE: homestead + +before_script: + # Install dependencies + - bash ci/docker_install.sh > /dev/null + - echo "Load sample DB" + +# We test PHP5.6 +test:5.5: + image: php:5.5 + script: + - phpunit --bootstrap=includes/kohana/modules/unittest/bootstrap.php --exclude-group kohana --colors --verbose $@ includes/kohana/modules/unittest/tests.php --site=test + only: + - test + tags: + - php + +# We test PHP7.0 (good luck with that) +test:5.6: + image: php:5.6 + script: + - phpunit --bootstrap=includes/kohana/modules/unittest/bootstrap.php --exclude-group kohana --colors --verbose $@ includes/kohana/modules/unittest/tests.php --site=test + only: + - test + tags: + - php + +# We test PHP7.0 (good luck with that) +test:7.0: + image: php:7.0 + script: + - phpunit --bootstrap=includes/kohana/modules/unittest/bootstrap.php --exclude-group kohana --colors --verbose $@ includes/kohana/modules/unittest/tests.php --site=test + only: + - test + tags: + - php diff --git a/ci/docker_install.sh b/ci/docker_install.sh new file mode 100644 index 00000000..b165a991 --- /dev/null +++ b/ci/docker_install.sh @@ -0,0 +1,18 @@ +#!/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 -yqq + +# Install phpunit, the tool that we will use for testing +curl -o /usr/local/bin/phpunit https://phar.phpunit.de/phpunit.phar +chmod +x /usr/local/bin/phpunit + +# Install mysql driver +# Here you can install any other extension that you need +docker-php-ext-install pdo_mysql