/
.travis.yml
63 lines (53 loc) · 1.43 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
dist: bionic
os: linux
language: php
services:
- redis
- mysql
cache:
directories:
- $HOME/.composer/cache/files
php:
- '7.4'
env:
- SONAR_SCANNER_VER=4.4.0.2170
before_install:
# Version
- php -v
- composer --version
- node -v
- yarn --version
# Xdebug
- phpenv config-rm xdebug.ini
# Composer
- composer self-update
install:
# Sonarqube
- wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VER-linux.zip
- unzip sonar-scanner-cli-$SONAR_SCANNER_VER-linux.zip
- mv sonar-scanner-$SONAR_SCANNER_VER-linux sonar
# Composer
- composer install --prefer-dist --optimize-autoloader --no-suggest --no-progress
# Yarn
- yarn install
before_script:
# Generate key
- php artisan key:generate --env testing
# Generate database
- mysql -e 'CREATE DATABASE travis_test DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;'
- php artisan migrate --env testing
# Build JS
- yarn production
script:
- phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml
after_success:
# Submit coverage report to https://codecov.io
- bash <(curl -s https://codecov.io/bash)
# Submit coverage report to self-hosted SonarQube
- sonar/bin/sonar-scanner -D sonar.host.url=$SONAR_HOST -D sonar.login=$SONAR_SECRET
notifications:
email:
recipients:
- hackersir-developer@googlegroups.com
on_success: change
on_failure: always