-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
33 lines (32 loc) · 1009 Bytes
/
.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
language: go
go:
- 1.12.x
addons:
apt:
packages:
- docker-ce
env:
global:
- DOCKER_COMPOSE_VERSION=1.22.0
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
git:
depth: 3
branches:
only:
- master
before_install:
- curl -L -s https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 -o $GOPATH/bin/dep
- chmod +x $GOPATH/bin/dep
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname
-s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- docker-compose up -d sonic
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH;
else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- export TAG=$(if [ -n "$TRAVIS_TAG" ]; then echo $TRAVIS_TAG; else echo $BRANCH;
fi)
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH, TAG=$TAG"
script:
- env GO111MODULE=on go test ./... --count 1