-
Notifications
You must be signed in to change notification settings - Fork 315
/
Copy pathcircle.yml
262 lines (247 loc) · 7.21 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
version: 2.1
executors:
linux:
docker:
- image: ethereum/cpp-build-env:10
commands:
build_and_test:
steps:
- checkout
- run:
name: "Environment"
command: |
CC=${CC:-cc}
CXX=${CXX:-cpp}
echo CC: $CC
echo CXX: $CXX
$CC --version
$CXX --version
cmake --version
- run:
name: "Configure"
working_directory: ~/build
command: cmake ../project -DCMAKE_INSTALL_PREFIX=~/install -DEVMC_TESTING=ON $CMAKE_OPTIONS
- run:
name: "Build"
command: cmake --build ~/build
- run:
name: "Test"
command: |
cmake --build ~/build --target test -- ARGS="-j4 --schedule-random --output-on-failure"
# Test statically linked end-to-end example
~/build/examples/evmc-example-static
# Test dynamically loaded end-to-end example
~/build/examples/evmc-example ~/build/examples/example_vm/libevmc-example-vm.so
- run:
name: "Install"
command: cmake --build ~/build --target install
- run:
name: "Package"
command: |
cmake --build ~/build --target package_source
cmake --build ~/build --target package
mkdir ~/package
mv ~/build/evmc-*.tar.gz ~/package
- store_artifacts:
path: ~/package
destination: package
- persist_to_workspace:
root: ~/build
paths:
- test/evmc-vmtester
- examples/evmc-example
jobs:
lint:
executor: linux
steps:
- checkout
- run:
name: "Check code format"
command: |
clang-format --version
find examples include lib test -name '*.hpp' -o -name '*.cpp' -o -name '*.h' -o -name '*.c' | xargs clang-format -i
git diff --color --exit-code
- run:
name: "Run codespell"
command: |
codespell --quiet-level=4 --ignore-words=./.codespell-whitelist
- run:
name: "Check bumpversion"
command: |
export PATH="/home/builder/.local/bin:$PATH"
pip3 install bumpversion
bumpversion --dry-run --verbose major
bumpversion --dry-run --verbose minor
bumpversion --dry-run --verbose patch
- run:
name: "Test documentation"
command: |
cat Doxyfile | sed 's/HTML_OUTPUT = ./HTML_OUTPUT = ..\/docs/' | doxygen - > doxygen.log 2> doxygen.warnings
if [ -s doxygen.warnings ]; then
printf '\n\nDoxygen warnings:\n\n'
cat doxygen.warnings
exit 1
fi
cat doxygen.log
- store_artifacts:
path: ~/docs
destination: docs
upload-docs:
executor: linux
steps:
- checkout
- run:
name: "Generate documentation"
command: doxygen Doxyfile
- run:
name: "Upload documentation"
command: |
git config user.email "[email protected]"
git config user.name "Documentation Bot"
git add --all
git commit -m "Update docs"
git push -f "https://[email protected]/ethereum/evmc.git" HEAD:gh-pages
build-cxx17:
executor: linux
environment:
CC: gcc-8
CXX: g++-8
CMAKE_OPTIONS: -DTOOLCHAIN=cxx17-pic
steps:
- build_and_test
build-cxx14-asan:
executor: linux
environment:
CC: clang-8
CXX: clang++-8
CMAKE_OPTIONS: -DTOOLCHAIN=cxx14-pic -DSANITIZE=address
steps:
- build_and_test
build-gcc6:
executor: linux
environment:
CC: gcc-6
CXX: g++-6
steps:
- build_and_test
build-clang38:
executor: linux
environment:
CC: clang-3.8
CXX: clang++-3.8
steps:
- build_and_test
build-32bit:
executor: linux
environment:
CMAKE_OPTIONS: -DTOOLCHAIN=cxx11-32bit
steps:
- run:
name: "Install GCC 32-bit"
command: sudo apt -q update && sudo apt -qy install g++-multilib
- build_and_test
bindings-go-latest:
docker:
- image: circleci/golang
steps: &bindings-go-steps
- checkout
- run:
name: "Go Build"
command: |
go get -v github.com/ethereum/go-ethereum/common
go build -v ./bindings/go/evmc
go vet -v ./bindings/go/evmc
go generate -v ./bindings/go/evmc
go test -v ./bindings/go/evmc
bindings-go-min:
docker:
- image: circleci/golang:1.9
steps: *bindings-go-steps
bindings-rust:
docker:
- image: rust:1
steps:
- checkout
- run:
name: Update environment
command: |
apt update
apt -y install libclang-dev clang
rustup component add rustfmt
rustup update
- run:
name: Check formatting
command: |
rustfmt --version
cargo fmt --all -- --check
- run:
name: Build
command: cargo build
- run:
name: Test
command: cargo test
- attach_workspace:
at: ~/build
- run:
name: Test with evmc-vmtester
command: |
~/build/test/evmc-vmtester target/debug/libexamplerustvm.so
- run:
name: Test with evmc-example
command: |
~/build/examples/evmc-example target/debug/libexamplerustvm.so
bindings-rust-asan-combined:
docker:
- image: rust:1
steps:
- checkout
- run:
name: Update environment
command: |
echo 'deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-8 main' >> /etc/apt/sources.list
wget -nv -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
apt -qq update
apt -yq install llvm-8-dev clang-8
rustup toolchain install nightly-x86_64-unknown-linux-gnu
rustup update
- run:
name: Build
command: RUSTFLAGS="-Z sanitizer=address" ASAN_OPTIONS=detect_leaks=1 cargo +nightly build --target x86_64-unknown-linux-gnu
- run:
name: Test
command: RUSTFLAGS="-Z sanitizer=address -C opt-level=0" ASAN_OPTIONS=detect_leaks=1 cargo +nightly test --target x86_64-unknown-linux-gnu
- attach_workspace:
at: ~/build
- run:
name: Test with evmc-vmtester
command: |
~/build/test/evmc-vmtester target/x86_64-unknown-linux-gnu/debug/libexamplerustvm.so
- run:
name: Test with evmc-example
command: |
~/build/examples/evmc-example target/x86_64-unknown-linux-gnu/debug/libexamplerustvm.so
workflows:
version: 2
evmc:
jobs:
- lint
- build-cxx17
- build-cxx14-asan
- build-gcc6
- build-clang38
- build-32bit
- bindings-go-latest
- bindings-go-min
- bindings-rust:
requires:
- build-cxx17
- bindings-rust-asan-combined:
requires:
- build-cxx14-asan
- upload-docs:
requires:
- lint
filters:
branches:
only:
- master