forked from CovenantSQL/CovenantSQL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
109 lines (99 loc) · 3.1 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
102
103
104
105
106
107
108
109
image: covenantsql/build
stages:
- build
- test
- cleanup
variables:
REVIEWDOG_VERSION: 0.9.11
REVIEWDOG_GITLAB_API_TOKEN: $REVIEWDOG_TOKEN
CODECOV_TOKEN: $CODECOV_TOKEN
UNITTESTTAGS: linux sqlite_omit_load_extension
CACHE_DIR: /CovenantSQL_bins
PIPELINE_CACHE: $CACHE_DIR/$CI_PIPELINE_IID
BIN_CACHE: $CACHE_DIR/$CI_PIPELINE_IID/bin
PREV_VERSION: v0.8.0
# gitlabci bins: 192.168.2.100:/data/CovenantSQL_bins
before_script:
# Setup dependency management tool
# - curl -L -s https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 -o $GOPATH/bin/dep
# - chmod +x $GOPATH/bin/dep
# - go get github.com/mattn/goveralls
# - go get github.com/haya14busa/goverage
# - go get github.com/golang/lint/golint
# - go get github.com/haya14busa/reviewdog/cmd/reviewdog
# - go get github.com/wadey/gocovmerge
- mkdir -p $GOPATH/src/github.com/CovenantSQL
- cp -r /builds/thunderdb/CovenantSQL $GOPATH/src/github.com/CovenantSQL/
- cd $GOPATH/src/github.com/CovenantSQL/CovenantSQL
# - dep ensure
- mkdir -p ~/bin/ && export PATH="~/bin/:$PATH"
- ulimit -n 8192
# - curl -fSL https://github.com/haya14busa/reviewdog/releases/download/$REVIEWDOG_VERSION/reviewdog_linux_amd64 -o ~/bin/reviewdog && chmod +x ~/bin/reviewdog
build:
stage: build
script:
- set -x
- make clean
- make use_all_cores
- mkdir -p ${BIN_CACHE}
- cp -r bin/* ${BIN_CACHE}/
unit-test:
stage: test
script:
- make clean
- cp -r ${BIN_CACHE}/* bin/
- ./alltest.sh
testnet-compatibility:
stage: test
script:
- set -o errexit
- set -o pipefail
- commit=$(git rev-parse --short HEAD)
- branch=$(git branch -rv |grep $commit | awk '{print $1}')
- if [[ $branch =~ "/beta_" ]]; then exit 0; fi
- make clean
- cp -r ${BIN_CACHE}/* bin/
- go test -tags "$UNITTESTTAGS" -bench=^BenchmarkTestnetMiner2$ -benchtime=5s -run ^$ ./cmd/cql-minerd/
- set -x
- ./test/testnet_client/run.sh
old-client-compatibility:
stage: test
script:
- set -o errexit
- set -o pipefail
- set -x
- commit=$(git rev-parse --short HEAD)
- branch=$(git branch -rv |grep $commit | awk '{print $1}')
- if [[ $branch =~ "/beta_" ]]; then exit 0; fi
- make clean
- cp -r ${BIN_CACHE}/* bin/
- ./test/compatibility/specific_old.sh client
old-bp-compatibility:
stage: test
script:
- set -o errexit
- set -o pipefail
- set -x
- commit=$(git rev-parse --short HEAD)
- branch=$(git branch -rv |grep $commit | awk '{print $1}')
- if [[ $branch =~ "/beta_" ]]; then exit 0; fi
- make clean
- cp -r ${BIN_CACHE}/* bin/
- ./test/compatibility/specific_old.sh bp
old-miner-compatibility:
stage: test
script:
- set -o errexit
- set -o pipefail
- set -x
- commit=$(git rev-parse --short HEAD)
- branch=$(git branch -rv |grep $commit | awk '{print $1}')
- if [[ $branch =~ "/beta_" ]]; then exit 0; fi
- make clean
- cp -r ${BIN_CACHE}/* bin/
- ./test/compatibility/specific_old.sh miner
cleanup_cache:
stage: cleanup
script:
- rm -r ${PIPELINE_CACHE}
when: on_success