forked from AdventureLookup/AdventureLookup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
93 lines (84 loc) · 3.76 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
dist: trusty
language: php
php:
- '7.0.21'
env:
global:
- SYMFONY_ENV=test
- PHPUNIT=vendor/symfony/phpunit-bridge/bin/simple-phpunit
matrix:
- TESTSUITE=unittests
- TESTSUITE=functional
- TESTSUITE=browser
services:
# ElasticSearch takes few seconds to start, but it also takes a while until
# we finally execute the tests, no need to wait!
# https://docs.travis-ci.com/user/database-setup/#ElasticSearch
- elasticsearch
cache:
directories:
- $HOME/.composer/cache/files
- node_modules
install:
- composer install -n
- |
if [ ${TESTSUITE} == "functional" ] || [ "$TESTSUITE" == "browser" ]; then
npm install npm@latest -g
npm install;
npm run prod;
fi;
before_script:
- |
if [ ${TESTSUITE} == "functional" ] || [ "$TESTSUITE" == "browser" ]; then
php bin/console doctrine:schema:create -n
php bin/console app:elasticsearch:reindex
fi;
script:
- set -e
# Check for Twig and Yaml syntax errors
- php bin/console lint:twig app
- php bin/console lint:yaml app
# Check for security issues in installed dependencies
# Specifying the endpoint is a (temporary) fix for Travis, see:
# https://github.com/travis-ci/travis-ci/issues/6339
# https://github.com/sensiolabs/security-checker/pull/77#issuecomment-290733113
- php bin/console security:check --end-point=http://security.sensiolabs.org/check_lock
# Start server and PhantomJS if browser tests are executed
- |
if [[ ${TESTSUITE} == "browser" ]]; then
bash scripts/start-phantomjs.sh
fi;
# Execute tests
# Only gather coverage on PHP 7.1, ignore browser tests for coverage.
- |
if [ "$TESTSUITE" == "browser" ]; then
$PHPUNIT --testsuite $TESTSUITE;
else
$PHPUNIT --testsuite $TESTSUITE --coverage-clover=coverage.xml;
bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy
fi;
jobs:
include:
- stage: deploy
services: []
env:
# Encrypted SSH_PORT
- secure: f4YeypBxXD4w4lRlHrOs6CO3LaO2sGOIYb5VYQFelOw1UbdYitgqHrbsD7avsMZEzzHj8b9QHvfpmu3jtPS+63J2lR1TRT0F0bdzf4pfkTM7Ucw9nIJcxiAuNQLwSzFr/zvAvshP/FiR8ex3jJsnjDlsvV0uJl7PDof+n81tOEGU0VJa4HtBiC86+GPr3ckkl47NCPtHtyAVOzHHZN8oNmHDqh6AWHC/irrz56+2e2rmgqrgKk530YbJTyjejrVVNgNUePUVYm5JNX1anH2plRecFyN3Ov6VJsP5U8P9ej/433igJ/l14euPYFaE3L6deyBfVQ64qGA19oGEbPMdpgUuP8NFbCB+FohmzFRzEZcYQvPam7+N6849u9DdV/rqImw3USjKcLKqFG6l056x/tXBQFMKHJ/jx9/2WuCGg2kd5fCQyZWB2avPq8ifHOkoT9mJAVWwD3u1GfsRJgDCnz8iXCutsFNVE0WGz4trqd3Oni03wZ7dh7RCiF/lTzsL4Py8bFUfl1JS3Z3G5dxR/9hpuhl1Z0YV7sekwpYBJmP4lEX3LMy04XTgMNYitGIQs8GgHKVxSpD0FRGxMcpjPyRcS85gaSvQreY8aCubC8NEE2HNXS96RGFrp7w3H/yyAVVqkTiTX4MAYqudLohBDYUJCz85lawEk648Vup61e8=
before_install: skip
install: skip
before_script: skip
script: skip
after_script: skip
before_deploy:
- openssl aes-256-cbc -K $encrypted_d7464a3e89e9_key -iv $encrypted_d7464a3e89e9_iv -in scripts/deployment_id_rsa.enc -out /tmp/deployment_id_rsa -d
- eval "$(ssh-agent -s)"
- chmod 600 /tmp/deployment_id_rsa
- ssh-add /tmp/deployment_id_rsa
# Add hashed public host keys to known hosts
- echo "|1|/o5a0+nceYEVEmz2IzW3gFdfUjQ=|nht4u7Jzhx0LvWoAyQgb2BpRI8U= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAaH7fLxrEAQA5GVcNqLTvXYRBfd8Ap0LMQLehsGkC8/G3pQBMITd38oqmfdlxCtvu4qdAYecmZ6a/B9E+vDGG4=" >> $HOME/.ssh/known_hosts
- echo "|1|9zrUMwfMs5nMGI51R1y6SUCKu5Y=|dvwXduUFjsR1jqF9w/JjPRcO41w= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAaH7fLxrEAQA5GVcNqLTvXYRBfd8Ap0LMQLehsGkC8/G3pQBMITd38oqmfdlxCtvu4qdAYecmZ6a/B9E+vDGG4=" >> $HOME/.ssh/known_hosts
deploy:
provider: script
script: bash $TRAVIS_BUILD_DIR/scripts/deploy-to-dev.sh
on:
branch: dev