1 |
yakumo_izuru |
1.1 |
box: yosssi/golang-latest@1.0.7 |
2 |
|
|
# Build definition |
3 |
|
|
build: |
4 |
|
|
# The steps that will be executed on build |
5 |
|
|
steps: |
6 |
|
|
# Sets the go workspace and places you package |
7 |
|
|
# at the right place in the workspace tree |
8 |
|
|
- setup-go-workspace |
9 |
|
|
|
10 |
|
|
# Gets the dependencies |
11 |
|
|
- script: |
12 |
|
|
name: go get |
13 |
|
|
code: | |
14 |
|
|
cd $WERCKER_SOURCE_DIR |
15 |
|
|
go version |
16 |
|
|
go get -t ./... |
17 |
|
|
|
18 |
|
|
# Build the project |
19 |
|
|
- script: |
20 |
|
|
name: go build |
21 |
|
|
code: | |
22 |
|
|
go build ./... |
23 |
|
|
|
24 |
|
|
# Test the project |
25 |
|
|
- script: |
26 |
|
|
name: go test |
27 |
|
|
code: | |
28 |
|
|
go test -cover -race ./... |
29 |
|
|
|
30 |
|
|
# Invoke goveralls |
31 |
|
|
- script: |
32 |
|
|
name: goveralls |
33 |
|
|
code: | |
34 |
|
|
go get github.com/axw/gocov/gocov |
35 |
|
|
go get github.com/mattn/goveralls |
36 |
|
|
echo "mode: count" > all.cov |
37 |
|
|
packages=(. cmd/gcss) |
38 |
|
|
for package in ${packages[@]}; do go test --covermode=count -coverprofile=$package.cov ./$package; sed -e "1d" $package.cov >> all.cov; done |
39 |
|
|
GIT_BRANCH=$WERCKER_GIT_BRANCH goveralls -coverprofile=all.cov -service=wercker.com -repotoken $COVERALLS_REPO_TOKEN |