-
Notifications
You must be signed in to change notification settings - Fork 506
/
.travis.yml
61 lines (60 loc) · 2.29 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
#notifications:
# slack:
# secure: NxhzhKGYnZYZiWVZM4w1PlZpTy9bbmNlvbqjL+9d4PvK4hFzPwQU12CchhBPeXNGLWBHg/ti6Scn/t5XIS3YJrkk4ydWmJBht5UId8uFZ1A7GCUnNNPTt2RG55lbJJdZSj01rOGZjEQbE5RyckEjgRzhZjdZ+HsjoPaRzWIBrvE=
language: php
php:
- '7.2'
- '7.3'
env:
- coverage="--coverage"
- coverage=""
matrix:
exclude:
- php: '7.3'
env: coverage="--coverage"
fast_finish: true
cache:
directories:
- "$HOME/.composer/cache"
services:
- mysql
before_install:
- mysql -e 'CREATE DATABASE ushahidi;'
- mysql -e "SET PASSWORD FOR travis@localhost = PASSWORD('password')";
- mysql -e "select version();"
- mysql -e "SET GLOBAL sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'"
- cp .env.travis .env
install:
- composer install --no-interaction
before_script:
- composer pre-test
- mysql -e 'SET @@GLOBAL.wait_timeout=1800'
- if [ "${coverage}" == "" ]; then (cd httpdocs/; php -S localhost:8000 -t . index.php &) fi
# Coverage
- if [ "${coverage}" != "" ]; then curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; fi
- if [ "${coverage}" != "" ]; then chmod +x ./cc-test-reporter; fi
- if [ "${coverage}" != "" ]; then ./cc-test-reporter before-build; fi
#- if [ "${coverage}" != "" ]; then (cd httpdocs/; php -S localhost:8000 -t . coverage.php &) fi
script:
- if [ "${coverage}" == "" ]; then composer test; fi
- if [ "${coverage}" != "" ]; then composer run coverage --timeout=0; fi
- composer lint
after_success:
- if [ "${coverage}" != "" ]; then travis_retry bin/php-coveralls -v; fi
- if [ "${coverage}" != "" ]; then travis_retry ./cc-test-reporter format-coverage -t clover coverage/phpunit.xml; fi
- if [ "${coverage}" != "" ]; then travis_retry ./cc-test-reporter upload-coverage; fi
### Deploy files now generated by Codeship
# before_deploy:
# - bin/release ${TRAVIS_TAG:-$TRAVIS_COMMIT}
# deploy:
# - provider: releases
# api_key:
# secure: C9dRB0X6/QWeKMIdDnuItGzzcJITf5oeGSd/Ry85//DawkC1nZn7yhjOFJuzOT1W8+lrmYgOtqVWaZdKuw36CEa4iooXCwDqn+6SWL1N/Q0JkJZH/pXkjSjtkfRV9iNlSRw3DF1yAcout1piqbD4BKDcAtrIf5apGQnXGzKjn/Q=
# file: build/*
# file_glob: true
# skip_cleanup: true
# on:
# repo: ushahidi/platform
# php: 5.5
# tags: true
# all_branches: true