This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy path.travis.yml
84 lines (68 loc) · 2.42 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
language: php
dist: trusty # TODO: Migrate to xenial: https://docs.travis-ci.com/user/trusty-to-xenial-migration-guide
cache:
directories:
- vendor
os:
- linux
# PHP tags are not supported on OS X: https://github.com/travis-ci/travis-ci/issues/2313
#- osx
php:
- 7.1
- 7.2
- 7.3
- 7.4
#- 8.0
#- nightly # Enable after migrating to Laravel 6.x
jobs:
allow_failures:
- php: nightly
services:
- mysql
- postgresql
env:
- DB=sqlite DB_CONNECTION=sqlite
- DB=mysql DB_CONNECTION=testing
- DB=mariadb DB_CONNECTION=testing
- DB=postgres DB_CONNECTION=pgsql
matrix:
include:
# Minimum PHP version for Laravel 5.6 is 7.1.3
- php: 7.1.3
dist: precise
env: DB=sqlite DB_CONNECTION=sqlite
- php: 7.1.3
dist: precise
env: DB=postgres DB_CONNECTION=pgsql
addons:
code_climate:
repo_token: $CODE_CLIMATE_TOKEN
mariadb: '10.0'
before_install:
#- sudo mount -o remount,size=50% /var/ramfs # https://docs.travis-ci.com/user/trusty-to-xenial-migration-guide
- sh -c "if [ '$DB' = 'sqlite' ]; then echo 'Creating database'; touch database/database.sqlite; fi"
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS homestead_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'CREATE DATABASE homestead_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ] || [ '$DB' = 'mariadb' ]; then echo 'Creating database'; mysql -e 'CREATE DATABASE homestead_test;'; fi"
install:
- chmod -R 777 bootstrap/cache
- chmod -R 777 storage
- cp .env.travis .env
- travis_retry composer self-update --2
- travis_retry composer update --no-interaction --no-suggest
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
- php artisan key:generate
- php artisan migrate --env=testing --no-interaction -vvv --database=$DB_CONNECTION
- php artisan db:seed --env=testing --no-interaction -vvv --database=$DB_CONNECTION
script:
- vendor/bin/phpunit -v --coverage-clover build/logs/clover.xml
after_script:
- php artisan migrate:rollback --env=testing --no-interaction -vvv --database=$DB_CONNECTION
- php vendor/bin/codacycoverage clover
- vendor/bin/test-reporter
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
after_success:
- bash <(curl -s https://codecov.io/bash)