-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
76 lines (71 loc) · 2.65 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
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
GIT_STRATEGY: clone
GO111MODULE: "on"
services:
- golang
test:
tags:
- docker
stage: test
image: golang
script:
# create the directory for the go package
- mkdir -p /go/src/git.noc.ruhr-uni-bochum.de/danieljankowski/gomatrix
# copy everything into the right place
- cp -R $CI_PROJECT_DIR/* /go/src/git.noc.ruhr-uni-bochum.de/danieljankowski/gomatrix/.
# change directory into the go package and prepare the tests
- cd /go/src/git.noc.ruhr-uni-bochum.de/danieljankowski/gomatrix
# install the dependencies
- go mod vendor
- mkdir report/
# run the tests with coverage report
- go test -count=1 -coverprofile report/cover.out -covermode=count ./...
# convert the coverage report to html and copy it back into the project directory
- go tool cover -html=report/cover.out -o report/cover.html
- cp -R report $CI_PROJECT_DIR/.
artifacts:
paths:
- ./report
expire_in: 1 week
lint:
tags:
- docker
stage: test
image: golang
script:
# create the directory for the go package
- mkdir -p /go/src/git.noc.ruhr-uni-bochum.de/danieljankowski/gomatrix
# copy everything into the right place
- cp -R $CI_PROJECT_DIR/* /go/src/git.noc.ruhr-uni-bochum.de/danieljankowski/gomatrix/.
# change directory into the go package and prepare the tests
- cd /go/src/git.noc.ruhr-uni-bochum.de/danieljankowski/gomatrix
# install the dependencies
- go mod vendor
- mkdir report/
# install golint
- go get -u golang.org/x/lint/golint
# run the tests with coverage report
- golint -set_exit_status $(go list ./... | grep -v /vendor/)
memory-sanitizer:
tags:
- docker
stage: test
image: golang
script:
# install clang
- export DEBIAN_FRONTEND=noninteractive
- apt update
- apt install -y clang
# create the directory for the go package
- mkdir -p /go/src/git.noc.ruhr-uni-bochum.de/danieljankowski/gomatrix
# copy everything into the right place
- cp -R $CI_PROJECT_DIR/* /go/src/git.noc.ruhr-uni-bochum.de/danieljankowski/gomatrix/.
# change directory into the go package and prepare the tests
- cd /go/src/git.noc.ruhr-uni-bochum.de/danieljankowski/gomatrix
# install the dependencies
- go mod vendor
- mkdir report/
# run the tests with coverage report
- CC=clang go test -count=1 -msan -short $(go list ./... | grep -v /vendor/)