forked from wasmx/fizzy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
153 lines (139 loc) · 4.11 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
version: 2.1
executors:
lint:
docker:
- image: ethereum/cpp-build-env:13-lint
linux-gcc-9:
docker:
- image: ethereum/cpp-build-env:13-gcc-9
linux-clang-9:
docker:
- image: ethereum/cpp-build-env:13-clang-9
macos:
macos:
xcode: 11.3.0
commands:
build:
description: "Build"
steps:
- checkout
- run:
name: "Environment"
command: |
CC=${CC:-cc}
CXX=${CXX:-cpp}
echo CC: $CC
echo CXX: $CXX
$CC --version
$CXX --version
cmake --version
# Create the toolchain.info file for cache key.
echo $TOOLCHAIN >> toolchain.info
$CXX --version >> toolchain.info
- restore_cache:
name: "Restore Hunter cache"
key: &hunter-cache-key hunter-{{arch}}-{{checksum "toolchain.info"}}-{{checksum "cmake/Hunter/init.cmake"}}
- run:
name: "Configure"
working_directory: ~/build
command: |
cmake ../project -G Ninja -DCMAKE_INSTALL_PREFIX=~/install -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DFIZZY_TESTING=ON $CMAKE_OPTIONS
- save_cache:
name: "Save Hunter cache"
key: *hunter-cache-key
paths:
- ~/.hunter/_Base/Cache
- run:
name: "Build"
command: cmake --build ~/build
test:
description: "Test"
steps:
- run:
name: "Test"
working_directory: ~/build
command: ctest -R ${TESTS_FILTER:-'.*'} -j4 --schedule-random --output-on-failure
jobs:
lint:
executor: lint
steps:
- checkout
- run:
name: "Check code format"
command: |
clang-format --version
find . -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
release-linux:
executor: linux-gcc-9
environment:
BUILD_TYPE: Release
steps:
- build
- test
release-macos:
executor: macos
environment:
BUILD_TYPE: Release
steps:
- run:
name: "Install System Dependencies"
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install cmake ninja
- build
- test
clang-latest-coverage:
executor: linux-clang-9
environment:
BUILD_TYPE: Coverage
TESTS_FILTER: unittests
steps:
- build
- test
- run:
name: "Collect coverage data"
working_directory: ~/build
command: |
mkdir coverage
find -name '*.profraw'
llvm-profdata merge *.profraw -o fizzy.profdata
llvm-cov report -instr-profile fizzy.profdata -Xdemangler llvm-cxxfilt \
-object bin/fizzy-unittests -use-color
llvm-cov report -instr-profile fizzy.profdata -Xdemangler llvm-cxxfilt > coverage/report.txt \
-object bin/fizzy-unittests
llvm-cov show -format=html -instr-profile fizzy.profdata -Xdemangler llvm-cxxfilt -region-coverage-lt=100 > coverage/missing.html \
-object bin/fizzy-unittests
llvm-cov show -format=html -instr-profile fizzy.profdata -Xdemangler llvm-cxxfilt > coverage/full.html \
-object bin/fizzy-unittests
llvm-cov export -instr-profile fizzy.profdata -format=lcov > fizzy.lcov \
-object bin/fizzy-unittests
genhtml fizzy.lcov -o coverage -t Fizzy
- store_artifacts:
path: ~/build/coverage
destination: coverage
- run:
name: "Upload to Codecov"
command: |
# Convert to relative paths
sed -i 's|$(pwd)/||' ~/build/fizzy.lcov
codecov --file ~/build/fizzy.lcov -X gcov
clang-latest-asan:
executor: linux-clang-9
environment:
BUILD_TYPE: Release
CMAKE_OPTIONS: -DSANITIZE=address
steps:
- build
- test
workflows:
version: 2
fizzy:
jobs:
- lint
- release-linux
- release-macos
- clang-latest-coverage
- clang-latest-asan