forked from scoringengine/scoringengine
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
44 lines (44 loc) · 1.46 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
language: python
sudo: required
services:
- docker
branches:
# Restrict push builds to only master
only:
- master
before_install:
# Fail immediately on any error
- set -e
install:
# Install newer version of docker-compose
- curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` -o docker-compose
- chmod +x docker-compose
- export PATH=./:$PATH
# Build containers needed for tests only
- make build-tests
before_script:
# Prep codeclimate reporting
- docker run -it
-e GIT_BRANCH=$TRAVIS_BRANCH
-e GIT_COMMIT_SHA=$TRAVIS_COMMIT
-e GIT_COMMITTED_AT=$(git log -1 --pretty=tformat:%ct $TRAVIS_COMMIT)
-e CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID
scoringengine/tester bash -c
"/usr/bin/cc-test-reporter before-build"
script:
- make run-tests
- ./tests/integration/run.sh
after_script:
# Push results to code climate
# only if a non PR and branch is master
- |
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
docker run -it \
-v artifacts:/app/artifacts \
-e GIT_BRANCH=$TRAVIS_BRANCH \
-e GIT_COMMIT_SHA=$TRAVIS_COMMIT \
-e GIT_COMMITTED_AT=$(git log -1 --pretty=tformat:%ct $TRAVIS_COMMIT) \
-e CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID \
scoringengine/tester bash -c \
"cp artifacts/coverage.xml ./ && /usr/bin/cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT"
fi