-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
122 lines (104 loc) · 3.08 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
#
# Travis CI
#
# @link https://docs.travis-ci.com/
# @link https://www.khs1994.com/categories/CI/Travis-CI/
#
language: php
# cache:
# directories:
# - cache
dist: xenial #16.04
# dist: trusty # 14.04
# addons:
# apt:
# sources:
# - mysql-5.7-trusty
# packages:
# - mysql-server
# - mysql-client
sudo: required
# services:
# - docker
# - rabbitmq
# - memcached
# - redis-server
# - mysql
# - mariadb
# - postgresql
# - mongodb
php:
# - 5.6
# - 7.0
- 7.1
- 7.2
- 7.3
- nightly
matrix:
fast_finish: true
allow_failures:
- php: 7.3
- php: nightly
# - env: KEY=VALUE
#
# 设置数据库
#
# @link https://docs.travis-ci.com/user/database-setup/
#
# addons:
# mariadb: '10.0'
# postgresql: '9.4'
before_install:
# update docker version
# - docker --version
# - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) test"
# - sudo apt-get update
# - sudo apt-get -y install docker-ce || sudo apt-get -f install
# - docker --version
# - sleep 15
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS tests;' -U postgres; fi"
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS tests_tmp;' -U postgres; fi"
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'CREATE DATABASE tests;' -U postgres; fi"
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'CREATE DATABASE tests_tmp;' -U postgres; fi"
- sh -c "if [ '$ENABLE_MONGODB' = 'enable' ]; then mongo mydb_test --eval 'db.createUser({user:"travis",pwd:"test",roles:["readWrite"]});'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS tests_tmp; CREATE DATABASE IF NOT EXISTS tests;'; fi"
- if [ "$DB" = 'mysql' ]; then sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('new_password') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"; fi
- if [ "$DB" = 'mysql' ]; then sudo mysql_upgrade -u root -pnew_password; fi
- if [ "$DB" = 'mysql' ]; then sudo service mysql restart; fi
- php .pcit.php
- echo "extension = redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
install:
- composer install -q
# - composer update -q
# - composer require illuminate/console
# - curl -fsSL http://get.sensiolabs.org/sami.phar -o sami
# - chmod +x sami
script:
# - phpenv config-rm xdebug.ini || echo "xdebug not available"
- vendor/bin/phpunit --coverage-clover=coverage.xml
# after_success:
# - bash <(curl -s https://codecov.io/bash)
# - ./sami update .sami.php
env:
global:
- MONGODB=disable
# - DB=sqlite
# - DB=mysql
# - DB=postgresql
# deploy:
# provider: pages
# skip-cleanup: true
# local-dir: build
# github-token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
# keep-history: true
# on:
# branch: master
#
# rabbitmq vhost / username guest password guest
#
#
# mysql 127.0.0.1 username-> root/travis 空密码
#
# memcached/redis -> localhost
#