forked from pluginsGLPI/formcreator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
85 lines (73 loc) · 2.5 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
language: php
sudo: required
services:
- mysql
env:
global:
- GLPI_SOURCE="https://github.com/glpi-project/glpi"
- CS=7.3
- DB_HOST=127.0.0.1
- MYSQL_ROOT_USER=root
- DB_USER=glpi
- DB_PASSWD=glpi
- DB_NAME=glpitest
- OLD_DB_NAME=glpiupgradetest
- PLUGINNAME=formcreator
- AFTER_SUCCESS_BRANCH=9.4.0
matrix:
- GLPI_BRANCH=9.4.0
- GLPI_BRANCH=9.5/bugfixes
# - GLPI_BRANCH=master
php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- nightly
matrix:
exclude:
- php: 5.6
env: GLPI_BRANCH=9.5/bugfixes
allow_failures:
- php: nightly
- env: GLPI_BRANCH=9.5/bugfixes
# - env: GLPI_BRANCH=master
before_script:
- |
if [ "$TRAVIS_SECURE_ENV_VARS" = "true" ]; then
mkdir ~/.composer -p
touch ~/.composer/composer.json
composer config -g github-oauth.github.com $GH_TOKEN
fi
- # set -x
- . ./tests/script-functions.sh
- . ./tests/script-specific-functions.sh
- init_databases
- install_glpi && install_plugin
script:
- COVERAGE="-ncc"
- if [ "${TRAVIS_PHP_VERSION:0:3}" = "$CS" ] && [ "$GLPI_BRANCH" = "$AFTER_SUCCESS_BRANCH" ]; then COVERAGE="--nccfc CommonTreeDropdown CommonDropdown CommonDBTM CommonGLPI CommonDBConnexity CommonDBRelation"; fi
- # install GLPI with an old schema of the plugin and upgrade it
- export GLPI_CONFIG_DIR="tests/config-$OLD_DB_NAME"
- init_glpi $OLD_DB_NAME $DB_USER $DB_PASSWD && init_plugin
- # upgrade test
- echo status of plugins
- mysql -h$DB_HOST -u$DB_USER -p$DB_PASSWD $OLD_DB_NAME -e "select name,directory,version,state from glpi_plugins WHERE directory IN ('formcreator')"
- plugin_test_upgrade
- # install GLPI with a fresh install of the plugin
- export GLPI_CONFIG_DIR="tests/config-$DB_NAME"
- init_glpi $DB_NAME $DB_USER $DB_PASSWD && init_plugin
- # fresh install test
- plugin_test_install
- plugin_test
- plugin_test_uninstall
- if [ ${TRAVIS_PHP_VERSION:0:3} == "$CS" ] && [ "$GLPI_BRANCH" = "$AFTER_SUCCESS_BRANCH" ]; then plugin_test_cs; fi
after_success:
- if [ ${TRAVIS_PHP_VERSION:0:3} == "$CS" ] && [ "$GLPI_BRANCH" = "$AFTER_SUCCESS_BRANCH" ]; then vendor/bin/parallel-lint --exclude vendor .; fi
# let's update the documentation and locales
- if [ ${TRAVIS_PHP_VERSION:0:3} == "$CS" ] && [ "$GLPI_BRANCH" = "$AFTER_SUCCESS_BRANCH" ]; then tests/after_success.sh; fi
- if [ ${TRAVIS_PHP_VERSION:0:3} == "$APIDOCS_PHP" ] && [ "$GLPI_BRANCH" = "$AFTER_SUCCESS_BRANCH" ]; then tests/apidocs.sh; fi
cache:
directories:
- $HOME/.composer/cache