forked from miracl/conflate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
47 lines (43 loc) · 1.83 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
language: go
go:
- 1.x
install:
- go get
- go get github.com/golang/lint/golint
- go get github.com/modocache/gover
- go get github.com/mattn/goveralls
- go get github.com/stretchr/testify/assert
- go get github.com/gordonklaus/ineffassign
- go get github.com/fzipp/gocyclo
- go get honnef.co/go/tools/cmd/megacheck
script:
- test -z "$(gofmt -s -l . 2>&1 | grep -v vendor | tee /dev/stderr)"
- go vet ./ ./conflate ./example
- golint -set_exit_status ./ ./conflate ./example
- ineffassign ./ ./conflate ./example
- gocyclo -over 15 ./*.go
- megacheck -simple.exit-non-zero=true -staticcheck.exit-non-zero=true -unused.exit-non-zero=true ./ ./conflate ./example
- megacheck -tests=false -simple.enabled=false -staticcheck.enabled=false -unused.exit-non-zero=true ./ ./conflate ./example
- go test -coverprofile .coverprofile
- $GOPATH/bin/goveralls -v -coverprofile .coverprofile -service=travis-ci
before_deploy:
- CGO_ENABLED=0 GOOS=linux go build -a -o releases/conflate -ldflags "-s -w -X main.version=$TRAVIS_TAG" ./conflate
- tar -czf releases/conflate.linux-amd64.tar.gz -C releases conflate
- CGO_ENABLED=0 GOOS=darwin go build -a -o releases/conflate -ldflags "-s -w -X main.version=$TRAVIS_TAG" ./conflate
- tar -czf releases/conflate.darwin-amd64.tar.gz -C releases conflate
- CGO_ENABLED=0 GOOS=windows go build -a -o releases/conflate.exe -ldflags "-s -w -X main.version=$TRAVIS_TAG" ./conflate
- tar -czf releases/conflate.windows-amd64.tar.gz -C releases conflate.exe
- cd releases
- sha256sum *.tar.gz > sha256sum.txt
- cd ..
deploy:
provider: releases
api_key: $GITHUB_TOKEN_KEY
file:
- "releases/conflate.linux-amd64.tar.gz"
- "releases/conflate.darwin-amd64.tar.gz"
- "releases/conflate.windows-amd64.tar.gz"
- "releases/sha256sum.txt"
skip_cleanup: true
on:
tags: true