forked from coopcycle/coopcycle-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
executable file
·74 lines (65 loc) · 2.59 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
notifications:
email: false
sudo: required
matrix:
fast_finish: true
services:
- postgresql
- docker
- redis-server
addons:
postgresql: '9.4'
language: php
php:
- '7.2.11'
env:
global:
- STRIPE_MOCK_API_BASE=http://localhost:12111
- SYMFONY_ENV=test
- NODE_ENV=test
before_install:
- sudo apt-get update -qq
- nvm install 8
install:
# Remove error could not access file "$libdir/postgis-2.3": No such file or directory
- sudo apt-get install -y $(apt-cache search postgis | awk '/^postgresql-9\.[2-5]-postgis-2.3/{printf " "$1}' )
- sudo service postgresql restart
- npm install
- npm install -g pm2
# Install OSRM
- mkdir -p var/osrm
- wget https://coopcycle.org/osm/paris-france.osm.pbf -P var/osrm
- docker run -t -v $(pwd)/var/osrm:/data osrm/osrm-backend:latest osrm-extract -p /opt/bicycle.lua /data/paris-france.osm.pbf
- docker run -t -v $(pwd)/var/osrm:/data osrm/osrm-backend:latest osrm-partition /data/paris-france.osrm
- docker run -t -v $(pwd)/var/osrm:/data osrm/osrm-backend:latest osrm-customize /data/paris-france.osrm
- docker run -t -v $(pwd)/var/osrm:/data -d -p 5000:5000 osrm/osrm-backend:latest osrm-routed --algorithm mld /data/paris-france.osrm
- docker run -t -d -p 12111:12111 stripemock/stripe-mock
before_script:
- phpenv config-rm xdebug.ini
# Configure JSON Web Token
- mkdir -p var/jwt
- openssl genrsa -out var/jwt/private.pem 4096
- openssl rsa -pubout -in var/jwt/private.pem -out var/jwt/public.pem
# Configure PostgreSQL
- psql -U postgres -c 'CREATE DATABASE coopcycle_test;'
- psql -U postgres -d coopcycle_test -c 'CREATE EXTENSION postgis;'
- psql -U postgres -d coopcycle_test -c 'CREATE EXTENSION postgis_topology;'
# Install PHP app
- cp app/config/parameters.yml.travis app/config/parameters.yml
# - composer install --prefer-dist
# Install Composer 1.7.2
# https://github.com/coopcycle/coopcycle-web/issues/492
- curl -sS https://getcomposer.org/installer | php -- --version=1.7.2
- php composer.phar install --prefer-dist
- php bin/console doctrine:schema:create --env=test
# - psql -U postgres -d coopcycle_test -f tests/AppBundle/Resources/sql/restaurants.sql > /dev/null
- php bin/console server:start 127.0.0.1:8080
- cp phpunit.xml.dist phpunit.xml
# Install JavaScript stuff
- pm2 start pm2.config.js --env=test
# - node_modules/.bin/webpack -p
script:
# - curl 'http://localhost:5000/route/v1/bicycle/2.3706188,48.877821;2.385706,48.887031?overview=full'
- phpunit
- php vendor/bin/behat -f progress
- node node_modules/.bin/mocha --require babel-core/register --exit js/tests/