forked from glpi-project/php-library-glpi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
57 lines (49 loc) · 2 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
language: php
git:
depth: false
env:
global:
- GLPI_URL=http://localhost:8080
- GLPI_ROOT_DIR=$TRAVIS_BUILD_DIR/../glpi
- GLPI_SOURCE=https://github.com/glpi-project/glpi
- CS=7.2
matrix:
- GLPI_BRANCH=9.2.1
- GLPI_BRANCH=9.2/bugfixes
- GLPI_BRANCH=master
before_script:
# The following line prevents PHP Warning about `$HTTP_RAW_POST_DATA` being deprecated
# https://stackoverflow.com/questions/26261001/warning-about-http-raw-post-data-being-deprecated
- echo 'always_populate_raw_post_data = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- rm -f composer.lock
# let's clone and config GLPI for the client
- git clone --depth=1 $GLPI_SOURCE -b $GLPI_BRANCH $GLPI_ROOT_DIR && cd $GLPI_ROOT_DIR
- composer install --no-interaction
- mysql -u root -e 'create database glpitest;'
- if [ -e scripts/cliinstall.php ] ; then php scripts/cliinstall.php --db=glpitest --user=root ; fi
- if [ -e tools/cliinstall.php ] ; then php tools/cliinstall.php --db=glpitest --user=root ; fi
# start a web server on port 8080, run in the background; wait for initialization
- php -S localhost:8080 > /dev/null 2>&1 &
- until netstat -an 2>/dev/null | grep '8080.*LISTEN'; do true; done
# go back to project dir and install vendors
- cd $TRAVIS_BUILD_DIR && composer install --no-interaction
script:
- vendor/bin/atoum -bf tests/bootstrap.php -d tests/unit
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "$CS" ]] && [ "$GLPI_BRANCH" = "9.2/bugfixes" ]; then vendor/bin/phpcs -p --standard=vendor/glpi-project/coding-standard/GlpiStandard/ src/ tests/; fi
after_success:
# let's update the documentation and make the releases
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "$CS" ]] && [ "$GLPI_BRANCH" = "9.2/bugfixes" ]; then .github/publish_changes.sh; fi
php:
- 5.6
- 7.0
- 7.1
- 7.2
- nightly
allow_failures:
- php: nightly
cache:
directories:
- $HOME/.composer/cache
- $HOME/bin
notifications:
webhooks: https://hooks.aethonan.pro/travisci/-1001061475099/