-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
40 lines (33 loc) · 1.44 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
sudo: required
env:
global:
- CC_TEST_REPORTER_ID=${CODE_CLIMATE_REPORTER_ID}
- GO_ENABLED=0
- GO111MODULE=on
- GOOS=linux
- GOARCH=amd64
- GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
- CURRENT_BRANCH=$(if [ ! -z "$TRAVIS_TAG" ]; then echo $TRAVIS_TAG; else echo "master"; fi)
language: go
go:
- 1.13.x
before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y install docker-ce
- go get -u github.com/axw/gocov/gocov
- go get -u github.com/AlekSi/gocov-xml
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
script:
- gocov test github.com/Microkubes/identity-provider/... | gocov-xml > coverage.xml && ./cc-test-reporter format-coverage -t cobertura -o coverage.json coverage.xml
- if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRIGGER" != "yes" ]; then
./cc-test-reporter upload-coverage -i coverage.json;
fi
after_success:
- if [ "$TRAVIS_BRANCH" == "$CURRENT_BRANCH" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
make push;
fi