forked from PJK/libcbor
/
config.yml
119 lines (110 loc) · 3.28 KB
/
config.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
version: 2.1
linux-setup: &linux-setup >
sudo apt-get update &&
sudo apt-get install -y gcc clang g++ cmake clang-format-8 cppcheck valgrind doxygen &&
sudo apt install libcmocka-dev
build-test: &build-test >
cmake -DWITH_TESTS=ON \
-DCBOR_CUSTOM_ALLOC=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DSANITIZE=OFF \
. &&
make VERBOSE=1 &&
ctest -VV
orbs:
codecov: codecov/codecov@3.2.2
jobs:
static-test:
machine:
image: ubuntu-2004:202010-01
steps:
- checkout
- run: *linux-setup
- run: cppcheck . --error-exitcode=1
- run: bash clang-format.sh --verbose && git diff-index --quiet HEAD
- run: >
cd doc &&
pip3 install -r source/requirements.txt &&
make html
build-and-test:
machine:
image: ubuntu-2004:202010-01
steps:
- checkout
- run: *linux-setup
- run: >
cmake -DWITH_TESTS=ON \
-DCBOR_CUSTOM_ALLOC=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DSANITIZE=OFF \
-DCOVERAGE=ON \
.
- run: make VERBOSE=1
- run: ctest -VV
- run: ctest -T Coverage
- codecov/upload
# TODO: Reenable, currently fails on libjson leak (package out of date)
# The issue actually seems to be in the instrumentation code, not
# libcbor (we don't use libjsoncpp)
# https://github.com/open-source-parsers/jsoncpp/issues/507
# - run: >
# ctest --output-on-failure -T memcheck | tee memcheck.out
# if grep -q 'Memory Leak\|IPW\|Uninitialized Memory Conditional\|Uninitialized Memory Read' memcheck.out; then
# exit 1
# fi;
build-and-test-clang:
machine:
image: ubuntu-2004:202010-01
steps:
- checkout
- run: *linux-setup
- run: >
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
- run: *build-test
build-and-test-arm:
machine:
image: ubuntu-2004:202101-01
resource_class: arm.medium
steps:
- checkout
- run: *linux-setup
- run: *build-test
build-bazel:
machine:
image: ubuntu-2004:202101-01
steps:
- checkout
- run: *linux-setup
- run: sudo apt install apt-transport-https curl gnupg
- run: curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
- run: sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
- run: echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
- run: sudo apt update && sudo apt install bazel
- run: bazel --version
- run: >
pushd examples/bazel &&
bazel run -s src:hello
build-and-test-osx:
macos:
xcode: 12.5.1
steps:
- checkout
- run: bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- run: brew install cmocka cmake
- run: *build-test
workflows:
build-and-test:
jobs:
- static-test
- build-and-test
- build-and-test-clang
- build-and-test-arm
- build-and-test-osx:
requires:
- build-and-test
filters:
branches:
only:
- master
- build-bazel