-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.gitlab-ci.yml
53 lines (46 loc) · 1.36 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Select image from https://hub.docker.com/r/_/php/
image: php:5.5
# Select what we should cache
cache:
paths:
- vendor/
# Services
services:
- mysql
# Variables
variables:
# Configure mysql service https://hub.docker.com/_/mysql/
MYSQL_DATABASE: "testdb"
MYSQL_ROOT_PASSWORD: "rootpass"
# Install dependencies
before_script:
# Install git, the php image doesn't have installed
- apt-get update -y
- apt-get install -y git libicu-dev libcurl4-openssl-dev libmcrypt-dev zlib1g-dev zip unzip
# Install php extensions
- docker-php-ext-install pdo_mysql mbstring intl curl mcrypt zip
- apt-get autoremove -y && apt-get clean all
# Install composer
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install
- php composer.phar run-script post-create-project-cmd
# Set mysql connection parameters
- sed -i "s/__DB_HOST__/mysql/g;s/__DB_NAME__/testdb/g;s/__DB_USER__/root/g;s/__DB_PASS__/rootpass/g" app/config/app.php
# We test PHP5.5 (the default) with MySQL
test:php55:
script:
- php vendor/bin/phpcs
- php vendor/bin/phpunit
# We test PHP5.5 (the default) with MySQL
test:php56:
image: php:5.6
script:
- php vendor/bin/phpcs
- php vendor/bin/phpunit
# We test PHP7 with MySQL, but we allow it to fail
test:php7:
image: php:7
script:
- php vendor/bin/phpcs
- php vendor/bin/phpunit
allow_failure: true