-
-
Notifications
You must be signed in to change notification settings - Fork 398
/
Copy path.travis.yml
48 lines (40 loc) · 1.34 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
language: go
go:
- 1.11.x
env:
- DEP_VERSION="0.5.0"
# Anything in before_script that returns a nonzero exit code will flunk the
# build and immediately stop. It's sorta like having set -e enabled in bash.
# Make sure golangci-lint is vendored.
before_install:
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.10.2
# Download the binary to bin folder in $GOPATH
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
# Make the binary executable
- chmod +x $GOPATH/bin/dep
install:
# Check the dependency, -skip-lock may be useful because the version are not fixed but depends
# from the branch master of the libraries so they change very often
- dep check -skip-vendor
- dep ensure
script:
# Check if the code is formatted
- $(exit $(go fmt ./... | wc -l))
# Run linter
- golangci-lint run
# Build and test
- go build
- go test -timeout 20m -v -coverpkg=./... -coverprofile=coverage.txt -covermode=atomic ./...
after_success:
- bash <(curl -s https://codecov.io/bash)
# calls goreleaser
deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash
on:
tags: true
condition: $TRAVIS_OS_NAME = linux
cache:
directories:
- $GOPATH/pkg/dep