-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
.travis.yml
110 lines (70 loc) · 2.11 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
# Required to run your project under the correct environment.
language: php
# Versions of PHP you want your project run with.
php:
- 5.6
- 7.0
- 7.1
- 7.2
- hhvm
# Commands to be run before your environment runs.
before_script:
- composer self-update
- composer install --prefer-source --no-interaction --dev
# Commands you want to run that will verify your build.
script: phpunit
# allow_failures: Allow this build to fail under the specified environments.
# fast_finish: If your build fails do not continue trying to build, just stop.
matrix:
allow_failures:
- php: 5.6
- php: hhvm
fast_finish: true
# Customize when the notification emails are sent.
notifications:
on_success: never
on_failure: always
Here I’ve added the PHP versions that are allowed for the projects.
before_script allows you to run command before the environment actually executes.
allow_failures contains the conditions that allow your build to fail.
notifications will notify you in all scenarios of build success or failure.
If you are using Symfony 3, you can add this script provided by Antonio Jiménez
# Project language
language: php
# Allows use container-based infrastructure
sudo: false
# Start mysql service
services:
- mysql
# Cache composer packages so "composer install" is faster
cache:
directories:
- $HOME/.composer/cache/files
# Matrix to test in every php version
matrix:
# Fast finish allows to set the build as "finished" even if the "allow_failures" matrix elements are not finished yet.
fast_finish: true
include:
- php: 5.5
- php: 5.6
- php: 7.0
- php: hhvm
allow_failures:
- php: hhvm
# Define an environment variable
env:
- SYMFONY_VERSION="3.0.*" DB=mysql
# Update composer
before-install:
- composer self-update
# Install composer dependencies,
# Create database, schema and fixtures
install:
- composer install
- cp app/config/parameters.yml.dist app/config/parameters.yml
- php bin/console doctrine:database:create --env=test
- php bin/console doctrine:schema:create --env=test
- php bin/console doctrine:fixtures:load -n --env=test
# Run script
script:
- phpunit