-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwercker.yml
More file actions
67 lines (58 loc) · 1.83 KB
/
wercker.yml
File metadata and controls
67 lines (58 loc) · 1.83 KB
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
64
65
66
67
box: golang:1.12-stretch
services:
- id: postgres:9.6-alpine
env:
POSTGRES_DB: testing
POSTGRES_USER: testing
POSTGRES_PASSWORD: testing
build:
steps:
- script:
name: make lint
code: |
make lint
- script:
name: go install
code: |
go install ./...
- script:
name: go get for go generate
code: |
go get -v github.com/mjibson/esc
- script:
name: go generate
code: |
go generate ./...
- script:
name: go get for go test
code: |
# for coverage
go get -v github.com/mattn/goveralls
- script:
name: go test with sqlite3
code: |
go test -v ./...
- script:
name: go test with postgres
code: |
GOEN_TEST_CONNSTR="dbname=testing user=testing password=testing host=${POSTGRES_PORT_5432_TCP_ADDR} port=${POSTGRES_PORT_5432_TCP_PORT} sslmode=disable" \
go test -tags postgres -v ./...
- script:
name: coverage
code: |
tags=(sqlite3 postgres)
coverprofile=''
for pkg in $(go list ./...); do
for tag in ${tags[@]}; do
covfile="$(echo $pkg | sed -e 's/github.com\/kamichidu\///' | sed -e 's/\//_/g')_${tag}.cov"
go test -cover -covermode count -coverprofile "$covfile" "$pkg"
if [[ -z "$coverprofile" ]]; then
coverprofile="${covfile}"
else
coverprofile="${coverprofile},${covfile}"
fi
done
done
# hotfix to tell current branch to goveralls
GIT_BRANCH="${WERCKER_GIT_BRANCH}" \
goveralls -service wercker -coverprofile "$coverprofile" -repotoken "$COVERALLS_TOKEN"