forked from pluginsGLPI/formcreator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
93 lines (81 loc) · 2.75 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
language: php
addons:
chrome: stable
sudo: required
services:
- mysql
env:
global:
- GLPI_SOURCE="https://github.com/glpi-project/glpi"
- CS=7.4
- FUNCTIONAL_TESTS=7.4
- 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.5/bugfixes
- PANTHER_CHROME_DRIVER_BINARY=$(which chromuim.chromedriver)
matrix:
- GLPI_BRANCH=9.5/bugfixes
# - GLPI_BRANCH=master
php:
- 7.2
- 7.3
- 7.4
- nightly
matrix:
exclude:
- php: 5.6
env: GLPI_BRANCH=9.5/bugfixes
- php: 7.0
env: GLPI_BRANCH=9.5/bugfixes
- php: 7.1
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 TEST_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 TEST_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
- SKIP_PANTHER_INSTALL=false
- SKIP_FUNCTIONAL_TESTS=true
- if [ ${TRAVIS_PHP_VERSION:0:3} = "${FUNCTIONAL_TESTS}" ]; then SKIP_FUNCTIONAL_TESTS=false; fi
- plugin_test_functional
- 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 plugin_after_success; fi
cache:
directories:
- $HOME/.composer/cache