forked from KnpLabs/DoctrineBehaviors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
122 lines (108 loc) · 3.24 KB
/
.travis.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
dist: xenial # see https://travis-ci.community/t/postgresql-fails-to-start-unrecognized-operating-system/4558
language: php
install:
- composer install
jobs:
include:
- &SQLITE_JOB
stage: test
name: "SQLite"
php: '7.2'
script:
- vendor/bin/phpunit
-
<<: *SQLITE_JOB
php: '7.2'
install:
- composer update --prefer-lowest
# PostgreSQL
- &POSTGRES_JOB
stage: test
name: "PostgreSQL"
services:
# https://docs.travis-ci.com/user/database-setup/#postgresql
- postgresql
env:
- DB_ENGINE=pdo_pgsql
- DB_HOST=localhost
- DB_NAME=orm_behaviors_test
- DB_USER=root
- DB_PASSWD=root
- DB_MEMORY=false
php: '7.2'
install:
- composer update ${COMPOSER_FLAGS}
before_script:
- psql -c 'CREATE DATABASE orm_behaviors_test' -U postgres
# see https://www.guru99.com/postgresql-create-alter-add-user.html step 5)
- psql orm_behaviors_test -c "CREATE USER root WITH PASSWORD 'root'" -U postgres
- psql orm_behaviors_test -c 'CREATE EXTENSION cube' -U postgres
- psql orm_behaviors_test -c 'CREATE EXTENSION earthdistance' -U postgres
script:
- vendor/bin/phpunit
-
<<: *POSTGRES_JOB
php: '7.2'
env:
- COMPOSER_FLAGS=--prefer-lowest
-
<<: *POSTGRES_JOB
php: '7.3'
-
<<: *POSTGRES_JOB
php: '7.3'
env:
- COMPOSER_FLAGS=--prefer-lowest
-
<<: *POSTGRES_JOB
php: '7.4'
-
<<: *POSTGRES_JOB
php: '7.4'
env:
- COMPOSER_FLAGS=--prefer-lowest
# MySQL
- &MYSQL_JOB
stage: test
name: "MySQL"
services:
# https://docs.travis-ci.com/user/database-setup/#mysql
- mysql
env:
- DB_ENGINE=pdo_mysql
- DB_HOST=localhost
- DB_NAME=orm_behaviors_test
- DB_USER=root
- DB_PASSWD=""
- DB_MEMORY=false
php: '7.2'
install:
- composer update ${COMPOSER_FLAGS}
before_script:
- mysql -e 'create database IF NOT EXISTS orm_behaviors_test' -uroot
script:
- vendor/bin/phpunit
-
<<: *MYSQL_JOB
php: '7.2'
env:
- COMPOSER_FLAGS=--prefer-lowest
-
<<: *MYSQL_JOB
php: '7.3'
-
<<: *MYSQL_JOB
php: '7.3'
env:
- COMPOSER_FLAGS=--prefer-lowest
-
<<: *MYSQL_JOB
php: '7.4'
-
<<: *MYSQL_JOB
php: '7.4'
env:
- COMPOSER_FLAGS=--prefer-lowest
cache:
directories:
- $HOME/.composer/cache