forked from glpi-project/glpi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
113 lines (110 loc) · 4.61 KB
/
config.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
version: 2
shared: &shared
steps:
- checkout
- run:
name: Dependencies
command: |
sudo apt-get update
sudo apt-get install -y mysql-client libpng-dev libxml2-dev
sudo docker-php-ext-install mysqli gd xmlrpc
sudo pecl install apcu <<< '' || sudo pecl install apcu-4.0.11 <<< ''
sudo docker-php-ext-enable apcu
echo "apc.enable=1" | sudo tee --append /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini
echo "apc.enable_cli=1" | sudo tee --append /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini
echo "memory_limit = 512M" | sudo tee --append /usr/local/etc/php/conf.d/docker-php-memory.ini
- run:
name: Composer
command: |
sudo composer self-update
sed -e '/"php":/d' -i composer.json
rm -f composer.lock
composer install --optimize-autoloader
- run:
name: PHP Parallel Lint
command: vendor/bin/parallel-lint --exclude files --exclude plugins --exclude vendor --exclude tools/vendor .
- run:
name: Update DB
command: |
mysql -h 127.0.0.1 -u root -e 'create database glpitest0723;'
mysql -h 127.0.0.1 -u root glpitest0723 < tests/glpi-0.72.3-empty.sql
cp tests/circleci.config_db.php tests/config_db.php
php scripts/cliupdate.php --config-dir=../tests --dev --tests
php scripts/cliupdate.php --config-dir=../tests --dev --tests |grep -q "No migration needed." || (echo "scripts/cliupdate.php FAILED" && exit 1)
php scripts/innodb_migration.php --config-dir=../tests
rm tests/config_db.php
- run:
name: Install DB
command: |
mysql -h 127.0.0.1 -u root -e 'create database glpitest;'
php scripts/cliinstall.php --db=glpitest --host=127.0.0.1 --user=root --tests
php scripts/cliupdate.php --config-dir=../tests --tests |grep -q "No migration needed." || (echo "scripts/cliupdate.php FAILED" && exit 1)
- run:
name: Database tests
command: php vendor/bin/atoum -p 'php -d memory_limit=512M' --debug --force-terminal --use-dot-report --configurations tests/telemetry.php --bootstrap-file tests/bootstrap.php --no-code-coverage --max-children-number 1 -d tests/database
- run:
name: Functionnal tests
command: php vendor/bin/atoum -p 'php -d memory_limit=512M' --debug --force-terminal --use-dot-report --configurations tests/telemetry.php --bootstrap-file tests/bootstrap.php --no-code-coverage --max-children-number 1 -d tests/functionnal
- run:
name: Unit tests
command: php vendor/bin/atoum -p 'php -d memory_limit=512M' --debug --force-terminal --use-dot-report --configurations tests/telemetry.php --bootstrap-file tests/bootstrap.php --no-code-coverage -d tests/units
- run:
name: WEB tests
command: |
php -S localhost:8088 tests/router.php &>/dev/null &
php vendor/bin/atoum -p 'php -d memory_limit=512M' --debug --force-terminal --use-dot-report --configurations tests/telemetry.php --bootstrap-file tests/bootstrap.php --no-code-coverage --max-children-number 1 -d tests/web
# - run:
# name: LDAP tests
# command: |
# ./tests/LDAP/ldap_run.sh
# composer testldap
- run:
name: Coding standards
command: if [[ $(php --version|grep "7\.2") ]]; then vendor/bin/phpcs -d memory_limit=512M -p --standard=vendor/glpi-project/coding-standard/GlpiStandard/ --ignore=/vendor/,/plugins/,/files/,/lib/,/config/,/tests/config,/css/tiny_mce,/.git ./; else echo "No CS for this version"; fi
- run:
name: sensiolabs/security-checker
command: vendor/bin/security-checker security:check
jobs:
"php5.6":
<<: *shared
docker:
- image: circleci/php:5.6-fpm-node-browsers
- image: circleci/mariadb:10.1
"php7.0":
<<: *shared
docker:
- image: circleci/php:7.0-fpm-node-browsers
- image: circleci/mariadb:10.2
"php7.1":
<<: *shared
docker:
- image: circleci/php:7.1-fpm-node-browsers
- image: circleci/mariadb:10.3
"php7.2":
<<: *shared
docker:
- image: circleci/php:7.2-fpm-node-browsers
- image: circleci/mariadb:10.3
"phplatest":
<<: *shared
docker:
- image: circleci/php:latest-node-browsers
- image: circleci/mariadb:10.3
workflows:
version: 2
tests_all:
jobs:
- php5.6
- php7.0
- php7.1
- php7.2
scheduled_build:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- phplatest