-
Notifications
You must be signed in to change notification settings - Fork 24
/
wercker.yml
61 lines (61 loc) · 1.82 KB
/
wercker.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
box: golang
build:
steps:
- setup-go-workspace
- script:
name: go get
code: |
cd $WERCKER_SOURCE_DIR
go version
go get -v -t ./...
- wallies/golint:
ignore-rules: "[ \"should have comment or be unexported\" ]"
- script:
name: go build
code: |
go build ./...
- script:
name: go test
code: |
go get launchpad.net/gocheck
go get github.com/axw/gocov/gocov
# Execute actual tests and store coverage result
gocov test ./... > coverage.json
- script:
name: Coverage
code: |
go get github.com/matm/gocov-html
gocov report coverage.json
gocov-html coverage.json > $WERCKER_REPORT_ARTIFACTS_DIR/coverage.html
- script:
name: Coveralls.io
code: |
# The COVERALLS_TOKEN is set in the project at
# wercker as project environment variable.
go get github.com/mattn/goveralls
goveralls -service='wercker.com' -repotoken $COVERALLS_TOKEN
- script:
name: gofmt
code: |
FIXED=$(go fmt ./... | wc -l)
if [ $FIXED -gt 0 ]; then echo "gofmt - $FIXED file(s) not formatted correctly, please run gofmt to fix this." >&2 && exit 1; fi
- script:
name: Benchmark
code: |
go test -test.bench ./...
- script:
name: go build
code: |
GOOS=linux GOARCH=amd64 go build -o main
deploy:
steps:
- script:
name: restore release tag
code: |
export RELEASE_TAG=$(date --utc "+%Y%m%d%H%M")
- wercker/github-create-release:
token: $GITHUB_TOKEN
tag: $RELEASE_TAG
- wercker/github-upload-asset:
token: $GITHUB_TOKEN
file: snapshot/terraform-control_linux_amd64.tar.gz