-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
50 lines (37 loc) · 1.32 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
# Config file for https://travis-ci.org/
language: php
services:
- docker
before_install:
- docker build -t $imagename .
before-script:
env:
# global will stay the same across all matrix possibilities (will not create additional combinations to run)
global:
- imagename=trip-cost-calculator
- containername=trip-cost-calculator
# Define the php versions against we want to test our code
php:
- 7.4
# Note: Code coverage requires php-xDebug extension enabled on CI server
install:
- docker run -v "$PWD/shared:/shared" -d --name $containername $imagename
# Testing the app (see phpunit.xml) for configs, generating Code Coverage report
script:
- docker run -v "$PWD/shared:/shared" $containername /bin/sh -c "make test-local"
- docker run -v "$PWD/shared:/shared" $containername /bin/sh -c "make codecov-local && mv coverage.xml /shared"
#after_script:
after_success:
# Submit coverage report to https://codecov.io
- ci_env=`bash <(curl -s https://codecov.io/env)`
- docker run -v "$PWD/shared:/shared" $ci_env -e CI=true $containername /bin/bash -c "bash <(curl -s https://codecov.io/bash) -f /shared/coverage.xml"
#after_failure:
# Monitor only these branches
branches:
only:
- main
- dev
# You can delete the cache using travis-ci web interface
cache:
directories:
- $HOME/.composer/cache