forked from c-ares/c-ares
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cirrus.yml
227 lines (222 loc) · 8.15 KB
/
.cirrus.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
# Copyright (C) The c-ares project and its contributors
# SPDX-License-Identifier: MIT
env:
CIRRUS_CLONE_DEPTH: 1
CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -G Ninja"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=ON"
task:
matrix:
- name: "Debian amd64"
env:
DIST: "DEBIAN"
LC_ALL: "C"
SCAN_BUILD: "scan-build"
MAKE: "make"
BUILD_ASAN: "yes"
BUILD_UBSAN: "yes"
BUILD_VALGRIND: "yes"
BUILD_COVERAGE: "yes"
BUILD_ANALYZE: "yes"
TEST_SYMBOL_VISIBILITY: "yes"
container:
image: debian:latest
- name: "Alpine amd64"
env:
DIST: "ALPINE"
LC_ALL: "C"
SCAN_BUILD: "scan-build"
MAKE: "make"
BUILD_ASAN: "yes"
BUILD_UBSAN: "yes"
BUILD_VALGRIND: "yes"
BUILD_ANALYZE: "yes"
TEST_SYMBOL_VISIBILITY: "yes"
container:
image: alpine:latest
- name: "Ubuntu OLD amd64"
env:
DIST: "UBUNTU"
LC_ALL: "C"
MAKE: "make"
container:
image: ubuntu:20.04
- name: "Debian arm64"
env:
DIST: "DEBIAN-ARM"
LC_ALL: "C"
SCAN_BUILD: "scan-build"
MAKE: "make"
# For whatever reason, ASAN and UBSAN are likely to result in compiler
# termination on debian arm64. I can't tell if this is really a crash
# or something like the OOM killer:
# /usr/bin/c++ -DHAVE_CONFIG_H=1 -D_GNU_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -I/tmp/cirrus-ci-build/cmakebld/test -I/tmp/cirrus-ci-build/cmakebld -I/tmp/cirrus-ci-build/cmakebld/src/lib -I/tmp/cirrus-ci-build -I/tmp/cirrus-ci-build/src/lib -I/tmp/cirrus-ci-build/include -fsanitize=address -Wall -Wextra -Wcast-align -Wformat-security -Wmissing-declarations -Wmissing-format-attribute -Wpacked-bitfield-compat -Wredundant-decls -Wvla -Wno-unused-parameter -Wconversion -Wfloat-equal -Wsign-conversion -fdiagnostics-color=always -g -fno-omit-frame-pointer -O0 -DGTEST_HAS_PTHREAD=1 -std=c++14 -MD -MT test/CMakeFiles/arestest.dir/ares-test-parse-a.cc.o -MF test/CMakeFiles/arestest.dir/ares-test-parse-a.cc.o.d -o test/CMakeFiles/arestest.dir/ares-test-parse-a.cc.o -c /tmp/cirrus-ci-build/test/ares-test-parse-a.cc
# c++: fatal error: Killed signal terminated program cc1plus
# Skip for now on arm.
BUILD_ASAN: "no"
BUILD_UBSAN: "no"
BUILD_ANALYZE: "yes"
arm_container:
image: debian:latest
- name: "FreeBSD amd64"
env:
DIST: "FREEBSD"
SCAN_BUILD: "scan-build"
MAKE: "gmake"
BUILD_ANALYZE: "yes"
TEST_SYMBOL_VISIBILITY: "yes"
freebsd_instance:
image_family: freebsd-13-3
- name: "MacOS"
env:
DIST: "MACOS"
SCAN_BUILD: "/opt/homebrew/opt/llvm/bin/scan-build-py"
MAKE: "make"
BUILD_ASAN: "yes"
BUILD_ANALYZE: "yes"
TEST_SYMBOL_VISIBILITY: "yes"
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-xcode:latest
- name: "iOS"
env:
DIST: "iOS"
MAKE: "make"
CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.0 -DCMAKE_OSX_ARCHITECTURES=armv7;armv7s;arm64 -G Ninja"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=OFF"
CFLAGS: "-arch armv7 -arch armv7s -arch arm64 -miphoneos-version-min=10.0"
CONFIG_OPTS: "--host=arm-apple-darwin10 --disable-tests"
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-xcode:latest
matrix:
- name: "CMAKE"
env:
BUILD_TYPE: "cmake"
- name: "CMAKE no threads"
only_if: $DIST == 'DEBIAN'
env:
BUILD_TYPE: "cmake"
CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_THREADS=OFF -G Ninja"
- name: "CMAKE HIDE SYMBOLS"
only_if: $TEST_SYMBOL_VISIBILITY == 'yes'
env:
BUILD_TYPE: "cmake"
CMAKE_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=OFF -DCARES_SYMBOL_HIDING=ON -G Ninja"
- name: "AUTOTOOLS"
env:
BUILD_TYPE: "autotools"
- name: "ASAN"
# ASAN on Linux automatically includes Leak Sanitizer
# FreeBSD just hangs trying to run tests, think it may be trying to run leak sanitizer
only_if: $BUILD_ASAN == 'yes'
env:
BUILD_TYPE: "asan"
CC: "clang"
CONFIG_OPTS: "--enable-debug"
CFLAGS: "-fsanitize=address"
CXXFLAGS: "-fsanitize=address"
LDFLAGS: "-fsanitize=address"
- name: "UBSAN"
# FreeBSD just hangs trying to run tests, think it may be trying to run leak sanitizer
only_if: $BUILD_UBSAN == 'yes'
env:
BUILD_TYPE: "ubsan"
CC: "clang"
CONFIG_OPTS: "--enable-debug"
CFLAGS: "-fsanitize=undefined -fno-sanitize-recover"
CXXFLAGS: "-fsanitize=undefined -fno-sanitize-recover"
LDFLAGS: "-fsanitize=undefined"
- name: "ANALYZE"
only_if: $BUILD_ANALYZE == 'yes'
env:
BUILD_TYPE: "analyze"
CC: "clang"
SCAN_WRAP: "${SCAN_BUILD} -v --status-bugs"
CONFIG_OPTS: "--enable-debug --disable-tests"
CMAKE_TEST_FLAGS: "-DCARES_BUILD_TESTS=OFF"
- name: "VALGRIND"
# FreeBSD just hangs trying to run tests, think it may be trying to run leak sanitizer
only_if: $BUILD_VALGRIND == 'yes'
env:
BUILD_TYPE: "valgrind"
TEST_WRAP: "valgrind --leak-check=full"
TEST_FILTER: "--gtest_filter=-*Container*:-*LiveSearchANY*"
- name: "COVERAGE"
only_if: $BUILD_COVERAGE == 'yes'
env:
BUILD_TYPE: "coverage"
CI_NAME: "cirrus-ci"
CI_BUILD_NUMBER: "${CIRRUS_TASK_ID}"
CI_BUILD_URL: "https://cirrus-ci.com/task/${CIRRUS_TASK_ID}"
CI_BRANCH: "${CIRRUS_BRANCH}"
CI_PULL_REQUEST: "${CIRRUS_PR}"
COVERALLS_REPO_TOKEN: "ENCRYPTED[a46bc6ca908e9e74f102c686cde67cae21d3e792dff46a60e860d1179d9349e8eb5a529132d0effefebdb0dbc3f95810]"
CONFIG_OPTS: "--enable-debug --disable-shared --enable-code-coverage --enable-tests"
install_script:
- |
case "${DIST}" in
ALPINE)
apk add cmake samurai gtest-dev autoconf autoconf-archive automake libtool pkgconf make
case "${BUILD_TYPE}" in
asan|lsan|ubsan)
apk add clang17 compiler-rt
;;
analyze)
apk add clang17 clang17-analyzer compiler-rt
;;
valgrind)
apk add gcc g++ valgrind
;;
*)
apk add gcc g++
;;
esac
;;
UBUNTU|DEBIAN*)
export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y cmake ninja-build autoconf automake libtool g++ libgmock-dev pkg-config
case "${BUILD_TYPE}" in
asan|lsan|ubsan)
apt-get install -yq clang
;;
analyze)
apt-get install -yq clang clang-tools
;;
valgrind)
apt-get install -yq valgrind
;;
coverage)
apt-get install -yq lcov git pip
pip3 install --break-system-packages --user cpp-coveralls
;;
esac
;;
FREEBSD)
# pkg upgrade -y && \
pkg install -y cmake ninja googletest pkgconf
case "${BUILD_TYPE}" in
asan|analyze|ubsan|lsan)
pkg install -y llvm autoconf automake libtool gmake
;;
autotools)
pkg install -y autoconf automake libtool gmake
;;
esac
;;
MACOS|iOS)
brew update && \
brew install ninja cmake googletest
case "${BUILD_TYPE}" in
asan|ubsan|lsan|analyze)
brew install llvm autoconf automake libtool make
;;
autotools)
brew install autoconf automake libtool make
;;
esac
;;
esac
script:
- ./ci/build.sh
- ./ci/test.sh
- if [ "$BUILD_TYPE" = "autotools" -a "$DIST" = "DEBIAN" ]; then ./ci/distcheck.sh ; fi
- if [ "$BUILD_TYPE" = "coverage" ]; then ./ci/covupload.sh ; fi