forked from phpmyadmin/phpmyadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
142 lines (130 loc) · 4.24 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# The Travis setup:
# - run testsuite for every PHP version
# - run lint for every PHP version
# - run Selenium for single PHP version
dist: trusty
language: php
services:
- mysql
sudo: required
install:
- if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then source ~/virtualenv/python3.6/bin/activate ; fi
- ./test/ci-install-$CI_MODE
- if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then case "$TRAVIS_PHP_VERSION" in hhvm*) ;; *) phpenv config-add test/php-noprofile.ini ;; esac ; fi
before_script:
- export TESTSUITE_PASSWORD=`openssl rand -base64 30`
- export TESTSUITE_BROWSERSTACK_KEY=`echo cHlDcHJTNmZwZjVlaUR2RmV6VkU= | base64 --decode`
- export PATH=~/.composer/vendor/bin/:$PATH
- mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
- mysql -uroot < sql/create_tables.sql
- mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
- ./test/start-local-server
script:
- ./scripts/generate-mo --quiet
- if [ $CI_MODE = test ] ; then ./test/ci-phplint ; fi
- ./test/ci-$CI_MODE
after_script:
- if [ -f vendor/bin/codacycoverage ] ; then php vendor/bin/codacycoverage clover || true ; fi
- if [ -f php.log ] ; then cat php.log ; fi
- if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi
- if [ -f build/logs/phpunit.json ] ; then ./scripts/phpunit-top-tests build/logs/phpunit.json ; fi
- if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi
- if [ "$CI_MODE" = "selenium" ] ; then ~/browserstack/BrowserStackLocal --daemon stop; fi
after_success:
- bash <(curl -s https://codecov.io/bash)
stages:
- name: "PHP Unit tests"
- name: "Lint and analyse code"
- name: "Documentation"
- name: "Other tests"
jobs:
include:
- stage: "Lint and analyse code"
name: "Lint PHP files"
php: "7.1"
env: CI_MODE=lint
- stage: "Lint and analyse code"
name: "Run phpstan"
php: "7.2"
env: CI_MODE=phpstan
- stage: "Documentation"
name: "Build docs"
php: "7.1"
env: CI_MODE=docs
- stage: "Documentation"
name: "Build API docs"
php: "7.1"
env: CI_MODE=apidocs
- stage: "PHP Unit tests"
name: "PHP 7.2"
os: osx
language: generic
env: CI_MODE=test
before_install:
- brew update
- brew install openldap libiconv [email protected] composer mariadb yarn
- brew link --force gettext
- sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /usr/local/etc/php/7.2/php.ini
- mysql.server start
- stage: "PHP Unit tests"
php: "7.3"
name: "PHP 7.3"
env: CI_MODE=test
- stage: "PHP Unit tests"
php: "7.2"
name: "PHP 7.2"
env: CI_MODE=test
- stage: "PHP Unit tests"
php: "7.1"
name: "PHP 7.1"
env: CI_MODE=test
- stage: "PHP Unit tests"
php: "nightly"
name: "PHP nightly"
env: CI_MODE=test
- stage: "PHP Unit tests"
name: "PHP 7.2"
os: windows
language: sh
env: CI_MODE=test
before_install:
- choco install php composer mariadb
- export PATH=/c/tools/php72:/c/ProgramData/ComposerSetup/bin:/c/"Program Files"/"MariaDB 10.2"/bin:$PATH
- PHP_EXTENSIONS="mysqli curl bz2 gd2 pdo_mysql"
- for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php72/php.ini ; done
- sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php72/php.ini
- find . -type f -name "*.php" -print0 | xargs -0 sed -i ':a;N;$!ba;s/\r//g'
- stage: "Other tests"
name: "Build release"
php: "7.1"
env: CI_MODE=release
- stage: "Other tests"
name: "Run selenium tests on Google Chrome"
php: "7.1"
env:
- CI_MODE=selenium
- TESTSUITE_SELENIUM_BROWSER=chrome
- TESTSUITE_USER=root
- TESTSUITE_URL=http://127.0.0.1:8000
allow_failures:
- php: "nightly"
env: CI_MODE=test
- php: "7.2"
env: CI_MODE=phpstan
- os: windows
cache:
pip: true
yarn: true
directories:
- $HOME/.composer/cache/
- $HOME/browserstack
- node_modules
# Install APT packages
# - git > 2.5.1 needed for worktrees
# - mysql server does not seem to be always present on Travis Trusty environment
addons:
apt:
packages:
- git
- mysql-server-5.6
- nginx