diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..22d524af7 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,35 @@ +before_script: + - bash ./lib/ci/setup.sh + +cache: + paths: + - ./vendor/ + +variables: + MYSQL_DATABASE: app + MYSQL_ROOT_PASSWORD: 'Database Password for Continuous Integration' + +test:php5.6-mysql5.5: + services: + - mysql:5.5 + image: php:5.6 + script: "php ./vendor/bin/codecept run unit --steps --debug" + +test:php7.1-mysql5.6: + services: + - mysql:5.6 + image: php:7.1 + script: "php ./vendor/bin/codecept run unit --steps --debug --coverage --coverage-xml --coverage-html" + +test:php7.2-mysql5.7: + services: + - mysql:5.6 + image: php:7.2 + script: "php ./vendor/bin/codecept run unit --steps --debug --coverage --coverage-xml --coverage-html" + +test:php7.3-mysql8.0: + services: + - name: mysql:8.0 + command: ["mysqld", "--default-authentication-plugin=mysql_native_password"] + image: php:7.3 + script: "php ./vendor/bin/codecept run unit --steps --debug --coverage --coverage-xml --coverage-html" \ No newline at end of file diff --git a/lib/ci/config.ci.yml b/lib/ci/config.ci.yml new file mode 100644 index 000000000..46216a8f5 --- /dev/null +++ b/lib/ci/config.ci.yml @@ -0,0 +1,10 @@ +--- +deployer: 'local' +url: 'http://set-this-to-your-acceptance-test-url.local/' +db: + host: 'mysql' + dbname: 'app' + user: 'root' + password: 'Database Password for Continuous Integration' + populate: true + dump_path: 'tests/_data/e107_v2.1.9.sample.sql' diff --git a/lib/ci/setup.sh b/lib/ci/setup.sh new file mode 100755 index 000000000..d952e9bc6 --- /dev/null +++ b/lib/ci/setup.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +apt-get update +apt-get install -y git zip libzip-dev + +pecl install zip +docker-php-ext-enable zip +pecl install xdebug +docker-php-ext-enable xdebug +docker-php-ext-install pdo_mysql + +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +php composer-setup.php +php -r "unlink('composer-setup.php');" + +php composer.phar install + +git submodule update --init --recursive --remote + +cp ./lib/ci/config.ci.yml ./config.yml \ No newline at end of file