forked from 0chain/0chain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
165 lines (148 loc) · 3.75 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
stages:
- prepare
- check
- build
- test
.template: &env-info
before_script:
- hostname && hostname -I
- env | grep -e CI_COMMIT -e CI_PIPELINE
.template: &only-protected
only:
variables:
- $CI_COMMIT_REF_PROTECTED == "true"
.template: &only-unprotected
only:
variables:
- $CI_COMMIT_REF_PROTECTED == "false"
build-base:
<<: *env-info
stage: prepare
tags:
- normal
script:
- ./docker.local/bin/build.base.sh
run-unit-tests:
<<: *env-info
stage: check
allow_failure: true
tags:
- normal
script:
- ./docker.local/bin/unit_test.sh --ci
measure-copy-paste:
<<: *env-info
stage: check
tags:
- normal
script:
- go get -u github.com/mibk/dupl
- cd code/go/0chain.net
- dupl -t 30
- dupl -t 30 -html > ../../../dupl.html
artifacts:
paths:
- dupl.html
expire_in: 1 month
build-magic-block:
<<: *env-info
stage: build
tags:
- normal
script:
- ./docker.local/bin/build.magic_block.sh
build-miners:
<<: *env-info
<<: *only-unprotected
stage: build
tags:
- normal
script:
- ./docker.local/bin/build.miners.sh
build-sharders:
<<: *env-info
<<: *only-unprotected
stage: build
tags:
- normal
script:
- ./docker.local/bin/build.sharders.sh
build-miners-integration:
<<: *env-info
<<: *only-protected
stage: build
tags:
- normal
script:
- ./docker.local/bin/build.miners-integration-tests.sh
- docker login www.0chain-ci.net:5050 -u $DEPLOY_USERNAME -p $DEPLOY_PASSWORD
- docker tag miner www.0chain-ci.net:5050/root/0chain:miner-$CI_COMMIT_SHORT_SHA
- docker tag miner www.0chain-ci.net:5050/root/0chain:miner-latest
- docker push www.0chain-ci.net:5050/root/0chain:miner-$CI_COMMIT_SHORT_SHA
- docker push www.0chain-ci.net:5050/root/0chain:miner-latest
build-sharders-integration:
<<: *env-info
<<: *only-protected
stage: build
tags:
- normal
script:
- ./docker.local/bin/build.sharders-integration-tests.sh
- docker login www.0chain-ci.net:5050 -u $DEPLOY_USERNAME -p $DEPLOY_PASSWORD
- docker tag sharder www.0chain-ci.net:5050/root/0chain:sharder-$CI_COMMIT_SHORT_SHA
- docker tag sharder www.0chain-ci.net:5050/root/0chain:sharder-latest
- docker push www.0chain-ci.net:5050/root/0chain:sharder-$CI_COMMIT_SHORT_SHA
- docker push www.0chain-ci.net:5050/root/0chain:sharder-latest
.template: &run-integration-tests
before_script:
- pwd
- hostname && hostname -I
- env | grep -e CI_COMMIT -e CI_PIPELINE
- docker pull www.0chain-ci.net:5050/root/0chain:miner-latest
- docker pull www.0chain-ci.net:5050/root/0chain:sharder-latest
- docker tag www.0chain-ci.net:5050/root/0chain:miner-latest miner
- docker tag www.0chain-ci.net:5050/root/0chain:sharder-latest sharder
- setsebool -P selinuxuser_execheap 1
- ./docker.local/bin/init.setup.sh
- ./docker.local/bin/setup_network.sh || true
- ./docker.local/bin/sync_clock.sh
test-view-change.fault-tolerance:
<<: *only-protected
<<: *run-integration-tests
stage: test
tags:
- virtual
script:
- ./docker.local/bin/start.conductor.sh view-change.fault-tolerance
test-view-change.byzantine:
<<: *only-protected
<<: *run-integration-tests
stage: test
tags:
- virtual
script:
- ./docker.local/bin/start.conductor.sh view-change.byzantine
test-miners:
<<: *only-protected
<<: *run-integration-tests
stage: test
tags:
- virtual
script:
- ./docker.local/bin/start.conductor.sh miners
test-sharders:
<<: *only-protected
<<: *run-integration-tests
stage: test
tags:
- virtual
script:
- ./docker.local/bin/start.conductor.sh sharders
test-no-view-change.fault-tolerance:
<<: *only-protected
<<: *run-integration-tests
stage: test
tags:
- virtual
script:
- ./docker.local/bin/start.conductor.sh no-view-change.fault-tolerance