-
Notifications
You must be signed in to change notification settings - Fork 8
/
.travis.yml
78 lines (64 loc) · 2.64 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
language: php
sudo: false
php:
- '7.3'
env:
- TRAVIS_NODE_VERSION="6"
cache:
apt: true
yarn: true
directories:
- node_modules
- vendor
- $HOME/.composer/cache
services:
- mysql
addons:
apt:
packages:
- nginx
branches:
only:
- master
install:
# PHP
- cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- phpenv config-rm xdebug.ini # Speeds up build
- phpenv config-add docs/travis/custom.php.ini
- cp docs/travis/www.conf ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/ # Fix the php 7 config https://www.marcus-povey.co.uk/2016/02/16/travisci-with-php-7-on-apache-php-fpm/
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# MySql
- mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql # load timezone names
- mysql -uroot --execute="SET GLOBAL time_zone = 'Europe/Berlin'"; # set the correct timezone (this has to match DEFAULT_TIMEZONE in the yii config)
- docs/travis/mysql-5-5-schema-workaround.sh
## Import the testing data
- mysql -e 'create database `mt-test`;'
- cat docs/schema.sql tests/_data/data.sql docs/triggers.sql | mysql -utravis mt-test
## Import the example data
- mysql -e 'create database muenchen_transparent;'
- cat docs/schema.sql docs/beispieldaten.sql docs/triggers.sql | mysql -uroot muenchen_transparent
# nginx
- ln -s `pwd` /tmp/muenchen-transparent
- nginx -c `pwd`/docs/nginx-test.conf
# Preparation for the ba-geojson script
- cp protected/config/main-test.php protected/config/main-production.php
- mkdir html/js/build
# dependencies
## Get the chosen node version
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- chmod 644 vendor/heise/shariff/index.php || true # Prevent a weird "has uncommitted changes" error message when updating shariff
- composer install --prefer-source # --prefer-source fixes github's limits
- yarn
- node_modules/.bin/gulp
script:
- vendor/bin/codecept run --env nohtmlvalidation # nohtmlvalidation is a workaround for the missing java 8
after_failure:
- vendor/bin/codecept run --debug --env nohtmlvalidation
- cat protected/runtime/application.log
- cat /tmp/error.log
- cat /tmp/access.log
- cat tests/_output/*
after_script:
- git checkout -- docs/schema.sql
- docs/travis/require-clean-working-tree.sh # git shouldn't recognize any altered files after installing the dependencies and running the tests
- nginx -c `pwd`/docs/travis/nginx-test.conf -s stop