-
Notifications
You must be signed in to change notification settings - Fork 15
/
.travis.yml
55 lines (50 loc) · 1.81 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
dist: bionic
language: php
sudo: required
services:
- mysql
matrix:
fast_finish: true
include:
- php: 8.0
env:
- CS_CHECKS=true
- SEND_COVERAGE=true
- PHPSTAN=true
- INFECTION=false
- php: 7.4
env:
- INFECTION=false
- php: nightly
env:
- INFECTION=false
allow_failures:
- php: nightly
before_script:
# Debug Java version
- java -version
# Creating the test database
- mysql -e "DROP DATABASE IF EXISTS phpunit_soluble_test_db;" -uroot
- mysql -e "create database phpunit_soluble_test_db;" -uroot
- zcat test/data/mysql/schema.sql.gz | mysql -uroot phpunit_soluble_test_db
- zcat test/data/mysql/data.sql.gz | mysql -uroot phpunit_soluble_test_db
# Setting up some directories
- mkdir build
- mkdir -p build/logs
- mkdir -p test/logs
# Build and launch a JavaBridge server in background
- ./.travis/launch_javabridge_server.sh
# On travis Javabridge needs some time to
# be fully running, assume 6 seconds
# and show the log file
- sleep 6 && cat ./.travis/webapp-runner.8083.log
- composer install
script:
- ./vendor/bin/phpunit -c .travis/phpunit.xml -v --coverage-clover=coverage.xml
- if [[ $CS_CHECKS == true ]]; then ./vendor/bin/php-cs-fixer --diff --dry-run -v fix; fi
- if [[ $PHPSTAN == true ]]; then composer phpstan; fi
- if [[ $INFECTION == true ]]; then ./vendor/bin/infection --configuration=.travis/infection.travis.json --test-framework=phpunit --min-msi=40 --min-covered-msi=40 --threads=4; fi
after_script:
- if [[ $SEND_COVERAGE == true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [[ $SEND_COVERAGE == true ]]; then php ocular.phar code-coverage:upload --format=php-clover coverage.xml; fi
- if [[ $SEND_COVERAGE == true ]]; then bash <(curl -s https://codecov.io/bash); fi