-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
59 lines (49 loc) · 1.53 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
language: php
php:
- 7.2
- 7.3
- 7.4
- 8.0
env:
matrix:
- PREFER_LOWEST="--prefer-lowest"
matrix:
include:
- php: 8.0
env: PREFER_LOWEST=""
services:
- mysql
cache:
directories:
- vendor
before_install:
- export MYSQL_DATABASE=test
- export MYSQL_USER=my_app
- export MYSQL_PASSWORD=secret
- export DB_HOST=localhost
before_script:
- mysql -u root < tests/test_app/database/init/001_init_database.sql
- mysql -u root -e "CREATE USER 'my_app'@'%' IDENTIFIED BY '${MYSQL_PASSWORD}';"
- mysql -u root -e "CREATE USER 'second_user'@'%' IDENTIFIED BY '${MYSQL_PASSWORD}${MYSQL_PASSWORD}';"
- mysql -u root -e "CREATE USER 'third_user'@'%' IDENTIFIED BY '${MYSQL_PASSWORD}${MYSQL_PASSWORD}${MYSQL_PASSWORD}';"
- mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'my_app';"
- mysql -u root -e "GRANT SELECT,SUPER ON *.* TO 'second_user';"
- mysql -u root -e "GRANT SELECT,SUPER ON *.* TO 'third_user';"
- composer update --prefer-dist --no-interaction $PREFER_LOWEST
script:
- |
if [[ $TRAVIS_PHP_VERSION == '8.0' ]]; then
vendor/bin/phpunit --verbose --coverage-clover=clover.xml
composer stan-setup
composer stan
else
composer test
fi
after_success:
- |
# obrained from https://github.com/codecov/codecov-bash/issues/133#issuecomment-447337868
if [[ $TRAVIS_PHP_VERSION == '8.0' ]]; then
curl -s https://codecov.io/bash > codecov
sed -i -e 's/TRAVIS_.*_VERSION/^TRAVIS_.*_VERSION=/' codecov
bash codecov
fi