-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
63 lines (58 loc) · 1.96 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
language: go
services:
- docker
jobs:
include:
- stage: test
go: 1.x
os: linux
install:
- go get github.com/golang/lint/golint
- go get github.com/onsi/ginkgo/ginkgo
- go get github.com/modocache/gover
- go get github.com/mattn/goveralls
before_script:
- go vet ./...
- test -z "$(gofmt -s -l . 2>&1 | grep -v vendor | tee /dev/stderr)"
- golint -set_exit_status $(go list ./...)
- docker-compose up -d
script:
- ginkgo -r -cover -coverpkg=./... -race -- -full
- gover
- goveralls -coverprofile=gover.coverprofile -service=travis-ci
- &test
stage: test alternative environments
install: skip
script: go test -race ./...
go: 1.x
os: linux
- <<: *test
go: 1.x
os: osx
- <<: *test
go: tip
os: linux
- stage: GitHub releases
install: skip
script: skip
before_deploy:
- CGO_ENABLED=0 GOOS=linux go build -a -o releases/casper -ldflags "-s -w -X main.version=$TRAVIS_TAG" ./cmd/casper
- tar -czf releases/casper.linux-amd64.tar.gz -C releases casper
- CGO_ENABLED=0 GOOS=darwin go build -a -o releases/casper -ldflags "-s -w -X main.version=$TRAVIS_TAG" ./cmd/casper
- tar -czf releases/casper.darwin-amd64.tar.gz -C releases casper
- CGO_ENABLED=0 GOOS=windows go build -a -o releases/casper.exe -ldflags "-s -w -X main.version=$TRAVIS_TAG" ./cmd/casper
- tar -czf releases/casper.windows-amd64.tar.gz -C releases casper.exe
- cd releases
- sha256sum *.tar.gz > sha256sum.txt
- cd ..
deploy:
provider: releases
api_key: $GITHUB_TOKEN_KEY
file:
- "releases/casper.linux-amd64.tar.gz"
- "releases/casper.darwin-amd64.tar.gz"
- "releases/casper.windows-amd64.tar.gz"
- "releases/sha256sum.txt"
skip_cleanup: true
on:
tags: true