forked from ethereum/aleth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
185 lines (164 loc) · 4.63 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
defaults:
update-submodules: &update-submodules
run:
name: "Update git submodules"
command: |
git submodule update --init
upload-hunter-cache: &upload-hunter-cache
run:
name: "Upload Hunter cache"
working_directory: ~/build
command: | # Upload Hunter cache if not PR build.
if [ ! "$CIRCLE_PR_NUMBER" ]; then
cmake --build . --target hunter_upload_cache
fi
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 -DCOVERAGE=ON $CMAKE_OPTIONS
build: &build
run:
name: "Build"
working_directory: ~/build
command: cmake --build . -- -j $BUILD_PARALLEL_JOBS
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
# If the DAG file does not exist, we have to run a single test with mining
# to create it before we can run tests in parallel.
if [ ! -f ~/.ethash/full-R23-0000000000000000 ]; then
test/testeth -t BlockChainSuite/updateStats
fi
ctest --output-on-failure -j $TEST_PARALLEL_JOBS
store-eth: &store-artifacts
store_artifacts:
path: ~/build/eth/eth
destination: eth
store_artifacts:
path: ~/build/test/testeth
destination: testeth
save-deps-cache: &save-deps-cache
cache-save:
name: "Save dependencies cache"
key: &deps-cache-key deps-2-{{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
save-ethash-dag: &save-ethash-dag
cache-save:
name: "Save Ethash DAG file"
key: ðash-dag-key ethash-dag0-{{arch}}
paths:
- ~/.ethash/full-R23-0000000000000000
restore-ethash-dag: &restore-ethash-dag
cache-restore:
name: "Restore Ethash DAG file"
key: *ethash-dag-key
upload-coverage-data: &upload-coverage-data
run:
name: "Upload coverage data"
command: |
pwd
$GCOV --version
codecov --required --gcov-exec "$GCOV" --gcov-root ~/build
linux-steps: &linux-steps
- checkout
- *update-submodules
- *environment-info
- *restore-deps-cache
- *configure
- *upload-hunter-cache
- *build
- *save-deps-cache
- *store-artifacts
- *restore-ethash-dag
- *test
- *save-ethash-dag
- *upload-coverage-data
version: 2
jobs:
Linux-Clang5:
environment:
- CXX: clang++-5.0
- CC: clang-5.0
- GCOV: llvm-cov-5.0 gcov
- GENERATOR: Ninja
- BUILD_PARALLEL_JOBS: 8
- TEST_PARALLEL_JOBS: 8
docker:
- image: ethereum/cpp-build-env
steps: *linux-steps
Linux-GCC6-Debug:
environment:
- BUILD_TYPE: Debug
- CXX: g++-6
- CC: gcc-6
- GCOV: gcov-6
- GENERATOR: Ninja
- BUILD_PARALLEL_JOBS: 4
- TEST_PARALLEL_JOBS: 4
# TODO: Fix memory leaks reported in leveldb.
# - CMAKE_OPTIONS: -DSANITIZE=address
# - ASAN_OPTIONS: detect_leaks=0
docker:
- image: ethereum/cpp-build-env
steps: *linux-steps
macOS-XCode9:
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"
command: |
pip install -q requests codecov &
HOMEBREW_NO_AUTO_UPDATE=1 brew install -q cmake ninja leveldb &
wait
- *restore-deps-cache
- *configure
- *upload-hunter-cache
- *build
- *save-deps-cache
- *store-artifacts
- *restore-ethash-dag
- *test
- *save-ethash-dag
- *upload-coverage-data
# TODO: Run GCC6 build only in develop branch.
# TODO: Enabled nightly builds and add more configs.
# TODO: Separate builds from testing jobs.
workflows:
version: 2
cpp-ethereum:
jobs:
- macOS-XCode9
- Linux-Clang5
- Linux-GCC6-Debug