-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
57 lines (44 loc) · 1.39 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
language: php
php:
- 7.2
addons:
mariadb: "10.2"
cache:
directories:
- "$HOME/.composer/cache/files"
- "$HOME/.npm"
- "$HOME/.cache/bower"
matrix:
include:
- env: WS_TEST=php
- env: WS_TEST=lint_php
- env: WS_TEST=js
fast_finish: true
branches:
only:
- master
- production
before_script:
# Faster builds if we don't need xdebug
- if [[ "$WS_TEST" != "php" ]]; then phpenv config-rm xdebug.ini; fi
# Install dependencies
- if [[ "$WS_TEST" = "js" ]]; then npm install; fi
- if [[ "$WS_TEST" = "php" ]]; then composer install; fi
# Set up DB
- mysql -u root -e 'create database weinstein_test;'
- mysql -u root -e "CREATE USER 'weinstein_test'@'localhost' IDENTIFIED BY 'test';"
- mysql -u root -e "GRANT SUPER on *.* to 'weinstein_test'@'localhost';"
- mysql -u root -e "GRANT ALL PRIVILEGES ON weinstein_test.* TO 'weinstein_test'@'localhost';"
# Copy environment file
- cp tests/test.env .env
- cat .env
script:
- echo "test suite $WS_TEST"
# PHP
- if [[ "$WS_TEST" = "php" ]]; then ./build/test_php.sh; fi
# Check PHP syntax
- if [[ "$WS_TEST" = "php_lint" ]]; then find . -name \*.php -not -path './vendor/*' -exec php -l "{}" \;; fi
# JS
- if [[ "$WS_TEST" = "js" ]]; then npm run build; fi
after_script:
- if [[ "$WS_TEST" = "php" ]]; then cat storage/logs/laravel.log; fi