This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.cirrus.yml
168 lines (162 loc) · 4.97 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
env:
CIRRUS_CLONE_DEPTH: 1
task:
matrix:
- name: "Debian amd64"
env:
DIST: "DEBIAN"
LC_ALL: "C"
SCAN_BUILD: "scan-build"
MAKE: "make"
container:
image: debian:latest
- name: "Debian arm64"
env:
DIST: "DEBIAN-ARM"
LC_ALL: "C"
SCAN_BUILD: "scan-build"
MAKE: "make"
arm_container:
image: debian:latest
- name: "FreeBSD amd64"
env:
DIST: "FREEBSD"
SCAN_BUILD: "scan-build"
MAKE: "gmake"
freebsd_instance:
image_family: freebsd-13-0
- name: "MacOS"
env:
DIST: "MACOS"
SCAN_BUILD: "/usr/local/opt/llvm/bin/scan-build"
MAKE: "make"
OPENSSL_ROOT_DIR: "/usr/local/opt/openssl@1.1"
PostgreSQL_DIR: "/usr/local/opt/libpq"
CONFIG_OPTS: "--with-openssl-dir=/usr/local/opt/openssl@1.1"
macos_instance:
image: big-sur-xcode
matrix:
- name: "CMAKE"
env:
BUILD_TYPE: "cmake"
- name: "AUTOTOOLS"
env:
BUILD_TYPE: "autotools"
- name: "ASAN"
# Only run on x64 debian, anything else is unstable
only_if: $DIST == 'DEBIAN'
env:
BUILD_TYPE: "asan"
CC: "clang"
CK_TIMEOUT_MULTIPLIER: "2"
- name: "ANALYZE"
env:
BUILD_TYPE: "analyze"
CC: "clang"
- name: "VALGRIND"
only_if: $DIST == 'DEBIAN'
env:
BUILD_TYPE: "valgrind"
CK_TIMEOUT_MULTIPLIER: 3
CK_FORK: "no"
os_deps_install_script:
- |
case "${DIST}" in
DEBIAN*)
apt-get update && \
apt-get install -y cmake libssl-dev doxygen check ninja-build git wget unzip
case "${BUILD_TYPE}" in
asan)
apt-get install -y clang
;;
analyze)
apt-get install -y clang clang-tools
;;
valgrind)
apt-get install -y valgrind
;;
autotools)
apt-get install -y automake autoconf libtool make
;;
esac
;;
FREEBSD)
# pkg upgrade -y && \
pkg install -y cmake check ninja git wget unzip
case "${BUILD_TYPE}" in
asan|analyze)
pkg install -y llvm
;;
autotools)
pkg install -y autoconf automake libtool gmake
;;
esac
;;
MACOS)
brew update && \
brew install openssl doxygen check ninja cmake git wget unzip
case "${BUILD_TYPE}" in
asan|analyze)
brew install llvm
;;
autotools)
brew install autoconf automake libtool make
;;
esac
;;
esac
fetch_vendor_src_script:
- |
mkdir -p thirdparty
git clone --depth=1 https://github.com/Monetra/mstdlib.git thirdparty/mstdlib
mkdir -p thirdparty/mstdlib/thirdparty thirdparty/mstdlib/thirdparty/sqlite-amalgamation
git clone --depth=1 https://github.com/c-ares/c-ares.git thirdparty/mstdlib/thirdparty/c-ares
wget https://sqlite.org/2021/sqlite-amalgamation-3360000.zip -O thirdparty/mstdlib/thirdparty/sqlite-amalgamation.zip
unzip -j thirdparty/mstdlib/thirdparty/sqlite-amalgamation.zip -d thirdparty/mstdlib/thirdparty/sqlite-amalgamation
build_script:
- |
case "${BUILD_TYPE}" in
cmake)
cmake -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DOPENSSL_ROOT_DIR="$OPENSSL_ROOT_DIR" -G Ninja -H. -B_builds && \
cmake --build _builds
;;
asan)
cmake -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DOPENSSL_ROOT_DIR="$OPENSSL_ROOT_DIR" -DM_ASAN=TRUE -G Ninja -H. -B_builds && \
cmake --build _builds
;;
autotools)
./buildconf.sh && \
mkdir build && \
cd build && \
../configure ${CONFIG_OPTS} && \
${MAKE} V=1 -j2
;;
analyze)
${SCAN_BUILD} -v cmake -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DOPENSSL_ROOT_DIR="$OPENSSL_ROOT_DIR" -G Ninja -H. -B_builds && \
${SCAN_BUILD} -v cmake --build _builds
;;
valgrind)
cmake -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DMSTDLIB_USE_VALGRIND=ON -DOPENSSL_ROOT_DIR="$OPENSSL_ROOT_DIR" -G Ninja -H. -B_builds && \
cmake --build _builds
;;
esac
test_script:
- |
case "${BUILD_TYPE}" in
cmake|analyze|asan|valgrind)
export LD_LIBRARY_PATH=`pwd`/_builds/lib:$LD_LIBRARY_PATH && \
cd _builds/test && CTEST_OUTPUT_ON_FAILURE=1 CK_VERBOSITY=verbose ctest -VV
;;
autotools)
cd build && \
export CK_VERBOSITY=verbose && \
export VERBOSE=1 && \
export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH && \
make check
;;
esac
deploy_script:
- |
if [ "${BUILD_TYPE}" == "cmake" -a "${DIST}" = "DEBIAN" ] ; then
./gh-pages-deploy.sh
fi