forked from NLnetLabs/nsd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cirrus.yml
124 lines (114 loc) · 4.55 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
# Cirrus CI instructions for building NSD
#
# These build instructions are based on the existing instructions and
# suggestions made by Jeffrey Walton (noloader) about using the Undefined
# Behavior sanitizer (UBSan) and the Address sanitizer (ASan).
#
# For now builds are limited to Linux, FreeBSD and macOS builds on AMD64, more
# may be added in the future.
ubuntu_2204_gcc11: &ubuntu_2204_gcc11
container:
image: ubuntu:jammy
env:
UBUNTU_CODENAME: jammy
COV_COMPTYPE: gcc
COV_PLATFORM: linux64
CC: gcc-11
bootstrap_script:
- apt-get update
install_script:
- apt-get install -y autoconf automake libtool make gcc-11 clang libc-dev libevent-dev libssl-dev flex bison
ubuntu_2204_clang14: &ubuntu_2204_clang14
container:
image: ubuntu:jammy
env:
UBUNTU_CODENAME: jammy
CC: clang-14
CLANG_VERSION: 14
bootstrap_script:
- apt-get update
install_script:
- apt-get install -y autoconf automake libtool make clang-${CLANG_VERSION} libc-dev libevent-dev libssl-dev flex bison
- update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} 10
freebsd_12_3: &freebsd_13_0
freebsd_instance:
image_family: freebsd-13-0
env:
CC: clang
install_script:
- pkg install --yes --quiet bash gmake autoconf automake libtool libevent
macos_13_1_xcode14_2: &macos_13_1_xcode14_2
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-xcode:latest
env:
CC: clang
COV_COMPTYPE: clang
COV_COMPTYPE: macOSX
install_script:
- brew install bash autoconf automake libtool openssl libevent flex bison
install_coverity: &install_coverity
env:
COV_ARC: "$CIRRUS_WORKING_DIR/cov-analysis-$COV_PLATFORM.tgz"
COV_DIR: "$CIRRUS_WORKING_DIR/coverity-scan-analysis"
PATH: "$PATH:$CIRRUS_WORKING_DIR/cov-analysis/bin"
install_coverity_script:
- test ! -d "${COV_DIR}" &&
mkdir -p "${COV_DIR}" &&
curl -s -S -F project="${CIRRUS_REPO_OWNER}/${CIRRUS_REPO_NAME}"
-F token="${COVERITY_SCAN_TOKEN}"
-o "${COV_ARC}"
"https://scan.coverity.com/download/cxx/${COV_PLATFORM}" &&
tar -xzf "${COV_ARC}" -C "${COV_DIR}"
- ln -s $(find "${COV_DIR}" -type d -name "cov-analysis*") cov-analysis
submit_to_coverity_scan: &submit_to_coverity_scan
submit_to_coverity_scan_script:
- tar -czf analysis-results.tgz cov-int
- curl -s -S -F project="${CIRRUS_REPO_OWNER}/${CIRRUS_REPO_NAME}"
-F token="${COVERITY_SCAN_TOKEN}"
-F version="$(git rev-parse --short HEAD)"
-F description="Cirrus CI build"
-F email="${COVERITY_EMAIL:[email protected]}"
"https://scan.coverity.com/builds"
env:
COVERITY_EMAIL: ENCRYPTED[effa3340c97e8cf92c0dbb564187d35b6829580cc2577b176d6c6fc9b775745f7130c56f5bd9ab2472f4ae818b6f3791]
COVERITY_SCAN_TOKEN: ENCRYPTED[8f67f850ca3d464ea87fa8dee17bbb0cfb2a991b6f401fd593fe0744eece838e325af438d62ee2d46c4e18a2bd5c873f]
task:
only_if: $CIRRUS_CRON != ''
name: "Build on Ubuntu 22.04 LTS with GCC 11 (Coverity Scan)"
<<: *ubuntu_2204_gcc11
<<: *install_coverity
build_script:
- autoconf && autoheader
- libtoolize -c -i || glibtoolize -c -i
- ./configure --enable-checking --disable-flto
- cov-configure --comptype ${COV_COMPTYPE} --compiler ${CC} --template
- cov-build --dir cov-int make
<<: *submit_to_coverity_scan
task:
matrix:
- name: "Build and test on Ubuntu 22.04 LTS with GCC 11"
<<: *ubuntu_2204_gcc11
- name: "Build and test on Ubuntu 22.04 LTS with Clang 14 (ASan+UBSan+LSan)"
<<: *ubuntu_2204_clang14
env:
CFLAGS: "-g2 -O0 -fsanitize=address,undefined,leak -fno-sanitize-recover=all"
- name: "Build and test on FreeBSD 13.0 (ASan+UBSan)"
<<: *freebsd_13_0
env:
CFLAGS: "-g2 -O0 -fsanitize=address,undefined -fno-sanitize-recover=all"
- name: "Build and test on macOS 13.1 with Xcode 14.2 (ASan+UBSan)"
<<: *macos_13_1_xcode14_2
env:
CFLAGS: "-g2 -O0 -fsanitize=address,undefined -fno-sanitize-recover=all"
OPENSSL: "/opt/homebrew/opt/openssl@3"
LIBEVENT: "/opt/homebrew/opt/libevent"
build_script:
- autoconf && autoheader
- libtoolize -c -i || glibtoolize -c -i
- ./configure --enable-checking --disable-flto --with-ssl=${OPENSSL:-yes} --with-libevent=${LIBEVENT:-yes}
- make -j 2
- make cutest
- ./cutest
- (cd tpkg/clang-analysis.tdir && bash clang-analysis.test)
- (cd tpkg && ./mini_tdir.sh -a ../.. exe checkconf.tdir)