-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
56 lines (43 loc) · 1.44 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
# Project language
language: php
# Allows use container-based infrastructure
sudo: false
# Start mysql service
services:
- postgresql
addons:
postgresql: "9.6"
php:
- '7.0'
# Cache composer packages so "composer install" is faster
cache:
directories:
- $HOME/.composer/cache/files
- .php_cs.cache
# Define an environment variable
env:
- SYMFONY_VERSION="3.4.*" DB=postgresql
before_install:
# Update Composer
- composer self-update
# Install Postgis
- sudo apt-get install postgresql-9.6-postgis-2.3 -y -q
# Create DB
- psql -c "CREATE USER foo WITH PASSWORD 'bar';" -U postgres
- psql -c 'create database travis_postgis;' -U postgres
- psql -c 'CREATE EXTENSION postgis;' -U postgres -d travis_postgis
- psql -c 'CREATE EXTENSION postgis_topology;' -U postgres -d travis_postgis
- psql -c 'GRANT ALL PRIVILEGES ON DATABASE travis_postgis to foo;' -U postgres -d travis_postgis
# 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 --if-not-exists
- php bin/console doctrine:schema:create --env=test
- php bin/console doctrine:fixtures:load -n --env=test
# Run script
script:
- vendor/bin/simple-phpunit --coverage-clover=coverage.xml
- ./vendor/bin/php-cs-fixer fix -v --dry-run --stop-on-violation
- bash <(curl -s https://codecov.io/bash)