forked from KnpLabs/DoctrineBehaviors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
83 lines (73 loc) · 2.35 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
dist: xenial # see https://travis-ci.community/t/postgresql-fails-to-start-unrecognized-operating-system/4558
language: php
install:
- composer install
jobs:
include:
-
stage: test
name: "SQLite"
php: '7.2'
script:
- vendor/bin/phpunit
# 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 --prefer-lowest
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.3'
-
<<: *POSTGRES_JOB
php: '7.4'
# 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 --prefer-lowest
before_script:
- mysql -e 'create database IF NOT EXISTS orm_behaviors_test' -uroot
script:
- vendor/bin/phpunit
-
<<: *MYSQL_JOB
php: '7.3'
-
<<: *MYSQL_JOB
php: '7.4'
cache:
directories:
- $HOME/.composer/cache