forked from ethereum/aleth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
332 lines (295 loc) · 8.39 KB
/
circle.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
common-steps:
update-submodules: &update-submodules
run:
name: "Update git submodules"
command: |
git submodule update --init
environment-info: &environment-info
run:
name: "Environment info"
command: |
echo CXX: $CXX
$CXX --version
$CXX --version > compiler.version
configure: &configure
run:
name: "Configure"
# Build "out-of-source" to have better coverage report
# (ninja is using relative paths otherwise).
working_directory: ~/build
command: |
cmake ../project -G "$GENERATOR" -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CMAKE_OPTIONS
build: &build
run:
name: "Build"
working_directory: ~/build
command: |
cmake --build . --target package -- -j $BUILD_PARALLEL_JOBS
mkdir -p ~/package
. aleth/buildinfo.sh
mv aleth.tar.gz ~/package/$PROJECT_NAME-$PROJECT_VERSION-$SYSTEM_NAME-$SYSTEM_PROCESSOR.tar.gz
test: &test
run:
name: "Test"
working_directory: ~/build
command: |
if [ $(uname) = Linux ]; then
export TMPDIR=/dev/shm
fi
export ETHEREUM_TEST_PATH=~/project/test/jsontests
ctest --output-on-failure -j $TEST_PARALLEL_JOBS
test-evmc-interpreter: &test-evmc-interpreter
run:
name: "Test EVMC Interpreter"
working_directory: ~/build
command: |
ETHEREUM_TEST_PATH=~/project/test/jsontests \
test/testeth -t GeneralStateTests -- --vm libaleth-interpreter/libaleth-interpreter.so
store-package: &store-package
store_artifacts:
path: ~/package
destination: package
add-package-to-workspace: &add-package-to-workspace
persist_to_workspace:
root: ~/package
paths:
- "*"
store-randomcode-seed: &store-randomcode-seed
store_artifacts:
path: ~/build/test/randomCodeSeed.txt
destination: randomCodeSeed.txt
save-deps-cache: &save-deps-cache
cache-save:
name: "Save dependencies cache"
key: &deps-cache-key deps-4-{{arch}}-{{checksum "compiler.version"}}-{{checksum "cmake/ProjectLibFF.cmake"}}
paths:
- ~/build/deps
restore-deps-cache: &restore-deps-cache
cache-restore:
name: "Restore dependencies cache"
key: *deps-cache-key
upload-coverage-data: &upload-coverage-data
run:
name: "Upload coverage data"
command: |
pwd
$GCOV --version
codecov --required --gcov-exec "$GCOV" --gcov-root ~/build
save-ccache: &save-ccache
save_cache:
name: "Save ccache"
key: ccache-1-{{arch}}-{{checksum "compiler.version"}}-{{.Branch}}-{{epoch}}
paths:
- ~/.ccache
restore-ccache: &restore-ccache
restore_cache:
name: "Restore ccache"
keys:
- ccache-1-{{arch}}-{{checksum "compiler.version"}}-{{.Branch}}
- ccache-1-{{arch}}-{{checksum "compiler.version"}}
paths:
- ~/.ccache
setup-ccache: &setup-ccache
run:
name: "Setup ccache"
command: |
ccache --version
ccache --show-stats
ccache --zero-stats
ccache --max-size=3G
stat-ccache: &stat-ccache
run:
name: "Show ccache stats"
command: |
ccache --show-stats
version: 2
jobs:
linux-clang6:
environment:
BUILD_TYPE: Release
CXX: clang++-6.0
CC: clang-6.0
GCOV: llvm-cov-6.0 gcov
GENERATOR: Ninja
BUILD_PARALLEL_JOBS: 8
TEST_PARALLEL_JOBS: 8
CMAKE_OPTIONS: -DALETH_INTERPRETER_SHARED=ON
docker:
- image: ethereum/cpp-build-env:7
steps:
- checkout
- *update-submodules
- *environment-info
- *restore-deps-cache
- *restore-ccache
- *setup-ccache
- *configure
- *build
- *stat-ccache
- *save-ccache
- *save-deps-cache
- *store-package
- *add-package-to-workspace
- *test
- *test-evmc-interpreter
linux-gcc6: &linux-gcc6
environment: &linux-gcc6-environment
BUILD_TYPE: RelWithDebInfo
CXX: g++-6
CC: gcc-6
GCOV: gcov-6
GENERATOR: Ninja
BUILD_PARALLEL_JOBS: 2
TEST_PARALLEL_JOBS: 4
CMAKE_OPTIONS: -DCOVERAGE=ON
docker:
- image: ethereum/cpp-build-env:7
steps:
- checkout
- *update-submodules
- *environment-info
- *restore-deps-cache
- *restore-ccache
- *setup-ccache
- *configure
- *build
- *stat-ccache
- *save-ccache
- *save-deps-cache
- *store-package
- *test
- *upload-coverage-data
linux-gcc6-nightly:
<<: *linux-gcc6
environment:
<<: *linux-gcc6-environment
CMAKE_OPTIONS: -DCOVERAGE=ON -DTESTETH_ARGS=--all
macos-xcode90:
environment:
CXX: clang++
GCOV: gcov
GENERATOR: Ninja
BUILD_PARALLEL_JOBS: 8
TEST_PARALLEL_JOBS: 8
macos:
xcode: "9.0"
steps:
- checkout
- *update-submodules
- *environment-info
- run:
name: "Install macOS dependencies"
# Python3 and requests are needed for Hunter upload.
command: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install -q cmake ninja python3
pip3 install -q requests gitpython
- *restore-deps-cache
- *configure
- *build
- *save-deps-cache
- *store-package
- *add-package-to-workspace
- *test
- *store-randomcode-seed
# The job collects built packages (available in the workspace) and
# uploads them to the GitHub release matching the git tag.
deploy:
docker:
- image: circleci/golang
steps:
- run:
name: "Install ghr"
command: go get -u github.com/tcnksm/ghr
- attach_workspace:
at: ~/package
- run:
name: "Create GitHub release"
command: |
prerelease_flag=$([[ $CIRCLE_TAG =~ ^v[0-9\.]+$ ]] || echo '-prerelease')
name="Aleth ${CIRCLE_TAG:1}"
ghr -u ethereum -r aleth -n "$name" $prerelease_flag $CIRCLE_TAG ~/package
# Builds aleth docker image and uploads it to Docker Hub.
docker-aleth: &docker-aleth
docker:
- image: circleci/golang
steps:
- checkout
- run:
name: "Update required git submodules"
command: git submodule update --init --recursive cmake/cable evmc scripts/dopple
- setup_remote_docker
- run:
name: "Build docker images"
command: |
docker build --target aleth -t ethereum/aleth:local -f scripts/docker/aleth.dockerfile .
docker build --target testeth -t ethereum/testeth:local -f scripts/docker/aleth.dockerfile .
- run:
name: "Push docker images"
command: |
tag=unknown
if [[ $NIGHTLY ]]; then
tag=nightly
elif [[ $CIRCLE_TAG =~ ^v[0-9].* ]]; then
tag=${CIRCLE_TAG:1}
else
tag=$(date +%Y%m%d)
fi
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER_ID --password-stdin
docker tag ethereum/aleth:local ethereum/aleth:$tag
docker push ethereum/aleth:$tag
echo "Pushed ethereum/aleth:$tag"
docker tag ethereum/testeth:local ethereum/testeth:$tag
docker push ethereum/testeth:$tag
echo "Pushed ethereum/testeth:$tag"
echo "See https://hub.docker.com/r/ethereum/aleth/tags/"
docker-aleth-nightly:
<<: *docker-aleth
environment:
NIGHTLY: true
workflows:
version: 2
aleth:
jobs:
- macos-xcode90:
filters:
tags:
only: /.*/
- linux-clang6:
filters:
tags:
only: /.*/
- linux-gcc6:
filters:
tags:
only: /.*/
- deploy:
requires:
- macos-xcode90
- linux-clang6
- linux-gcc6
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9].*/
- docker-aleth:
requires:
- macos-xcode90
- linux-clang6
- linux-gcc6
filters:
branches:
only: docker
tags:
only: /^v[0-9].*/
nightly:
triggers:
# - schedule:
# cron: "0 0 * * *"
# filters:
# branches:
# only:
# - master
jobs:
- linux-gcc6-nightly
- docker-aleth-nightly