-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
101 lines (96 loc) · 3.06 KB
/
.gitlab-ci.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
before_script:
- go version
stages:
- test
- deploy
Unit tests:
stage: test
except:
- /^[0-9]+\./
tags:
- golang
- mongo # Require an available mongo service
- strong # Disable this build on small runners
services:
- "lesterpig/mongo:latest" # Use this light version of mongo
- "lesterpig/postfix:latest"
artifacts:
paths:
- "coverage.html"
script:
- "ln -s $(pwd) $GOPATH/src/dfss"
- "./build/deps.sh"
- "cd $GOPATH/src/dfss && make install"
- "go test -coverprofile auth.part -v dfss/auth"
- "go test -coverprofile mgdb.part -v dfss/mgdb"
- "go test -coverprofile mails.part -v dfss/mails"
- "go test -coverprofile net.part -v dfss/net"
- "go test -coverprofile dfssp_authority.part -v dfss/dfssp/authority"
- "go test -coverprofile dfssp_user.part -v dfss/dfssp/user"
- "go test -coverprofile dfssp_contract.part -v dfss/dfssp/contract"
- "go test -coverprofile dfssp_templates.part -v dfss/dfssp/templates"
- "go test -coverprofile dfssp_common.part -v dfss/dfssp/common"
- "go test -coverprofile dfssc_common.part -v dfss/dfssc/common"
- "go test -coverprofile dfssc_security.part -v dfss/dfssc/security"
- "go test -coverprofile dfssc_user.part -v dfss/dfssc/user"
- "go test -coverprofile dfssc_user.part -v dfss/dfssc/sign"
- "go test -coverprofile dfsst_entities.part -v dfss/dfsst/entities"
- "go test -coverprofile dfsst_resolve.part -v dfss/dfsst/resolve"
- "go test -coverprofile dfsst_server.part -v dfss/dfsst/server"
- "echo 'mode: set' *part > c.out"
- "grep -h -v 'mode: set' *part >> c.out"
- "go tool cover -html=c.out -o coverage.html"
Integration tests:
stage: test
except:
- /^[0-9]+\./
tags:
- golang
- mongo
- goqt
services:
- "lesterpig/mongo:latest"
script:
- "ln -s -f $(pwd) $GOPATH/src/dfss"
- "./build/deps.sh"
- "cd $GOPATH/src/dfss && make install"
# Copy required files
- "cp $GOPATH/src/github.com/visualfc/goqt/bin/* $GOPATH/src/dfss/dfssd/"
# Build ressources
- "cd $GOPATH/src/dfss/dfssd/gui && ../goqt_rcc -go gui -o application.qrc.go application.qrc"
# Build binary
- "cd $GOPATH/src/dfss/dfssd && go build -ldflags \"-r .\" -o dfssd"
# Install binary
- "cp $GOPATH/src/dfss/dfssd/dfssd $GOPATH/bin/"
- "cp $GOPATH/src/dfss/dfssd/libqtdrv.ui.so.1 /lib/"
# Start integration tests
- "go test -v dfss/tests"
Code lint:
stage: test
except:
- /^[0-9]+\./
tags:
- golang
- lint
script:
- "ln -s $(pwd) $GOPATH/src/dfss"
- "go get -u github.com/alecthomas/gometalinter"
- "./build/deps.sh"
- "cd $GOPATH/src/dfss && make install_all"
- "gometalinter --install --update"
- "gometalinter -t --deadline=900s -j1 --skip=api --skip=fixtures --skip=gui --skip=dfssd --disable=aligncheck ./..."
Deploy:
stage: deploy
only:
- /^v[0-9]/
- master
tags:
- golang
- strong
- goqt
- deploy
script:
- "ln -s -f $(pwd) $GOPATH/src/dfss"
- "./build/deps.sh"
- "make release"
- "make deploy"