-
Notifications
You must be signed in to change notification settings - Fork 402
213 lines (189 loc) · 9.62 KB
/
Copy pathci.yml
File metadata and controls
213 lines (189 loc) · 9.62 KB
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
name: Ubuntu
'on':
pull_request:
push:
branches:
- master
- develop
- feature/**
env:
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
UBSAN_OPTIONS: print_stacktrace=1
ASAN_OPTIONS: detect_odr_violation=2
CCACHE_DIR: /home/runner/.cache/ccache
CCACHE_NOHASHDIR: true
CPM_SOURCE_CACHE: /home/runner/.cache/CPM
REDIS_SLEEP_WORKAROUND_SECONDS: 60
jobs:
posix:
strategy:
fail-fast: false
matrix:
include:
- cmake-flags: >-
-GNinja
-DCMAKE_CXX_COMPILER=clang++-18
-DCMAKE_C_COMPILER=clang-18
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_CXX_STANDARD=20
-DUSERVER_SANITIZE="ub addr"
-DUSERVER_NO_WERROR=0
-DUSERVER_BUILD_ALL_COMPONENTS=1
-DUSERVER_BUILD_SAMPLES=1
-DUSERVER_BUILD_TESTS=1
-DUSERVER_FEATURE_YDB=0
-DUSERVER_NAMESPACE=userver_ns
-DUSERVER_NAMESPACE_BEGIN="namespace userver_ns { inline namespace
v1 {"
-DUSERVER_NAMESPACE_END="}}"
os: ubuntu-24.04
info: clang-18 + debug + sanitize addr+ub
id: ubuntu24_clang18_debug_sanitize-addr-ub
# Sanitizer consumes too much virtual memory and Subprocess tests fail with:
# "Error while fork: Cannot allocate memory" (std::system_error)
tests-flags: '--gtest_filter=-Subprocess.*'
tests-env: ''
- cmake-flags: >-
-GNinja
-DCMAKE_CXX_COMPILER=g++-13
-DCMAKE_C_COMPILER=gcc-13
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CXX_STANDARD=20
-DUSERVER_SANITIZE=""
-DUSERVER_NO_WERROR=1
-DUSERVER_BUILD_ALL_COMPONENTS=1
-DUSERVER_BUILD_SAMPLES=1
-DUSERVER_BUILD_TESTS=1
os: ubuntu-24.04
info: gcc-13 + release
id: ubuntu24_gcc13_release
tests-flags: '--gtest_filter=-StackUsageMonitorTest.BacktraceLogging'
tests-env: ''
name: '${{matrix.os}}: ${{matrix.info}}'
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v7
- name: Restore cached directories
id: restore-cache
uses: actions/cache/restore@v6
with:
path: |
${{env.CCACHE_DIR}}
${{env.CPM_SOURCE_CACHE}}
key: 'ubuntu-cache-dir ${{matrix.id}} ${{github.ref}} run-${{github.run_number}}'
restore-keys: |
ubuntu-cache-dir ${{matrix.id}} ${{github.ref}}
ubuntu-cache-dir ${{matrix.id}}
- name: Setup ramdrive for testsuites
run: |
sudo mkdir -p "/mnt/ramdisk/$USER"
sudo chmod 777 "/mnt/ramdisk/$USER"
sudo mount -t tmpfs -o size=2048M tmpfs "/mnt/ramdisk/$USER"
- name: Free disk space
run: ./scripts/githubci_free_space.sh
- name: Add confluentinc repositories
if: matrix.os != 'ubuntu-24.04'
run: |
# Adding librdkafka confluent repositories as in https://docs.confluent.io/platform/current/installation/installing_cp/deb-ubuntu.html#get-the-software
gpg_retrieve_keyserver() {
GNUPGHOME=$(mktemp -d)
GNUPGHOME="$GNUPGHOME" gpg --no-default-keyring --keyring "/usr/share/keyrings/$2.gpg" --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $1
rm -rf "$GNUPGHOME"
chmod a+r "/usr/share/keyrings/$2.gpg"
}
gpg_retrieve_keyserver 8B1DA6120C2BF624 confluent
printf "\
deb [arch=amd64 signed-by=/usr/share/keyrings/confluent.gpg] https://packages.confluent.io/deb/7.6 stable main\n\
deb [signed-by=/usr/share/keyrings/confluent.gpg] https://packages.confluent.io/clients/deb $(lsb_release -cs) main\n" \
| sudo tee /etc/apt/sources.list.d/confluent.list
- name: Add missing repositories
run: |
sudo apt update
# Instructions from https://clickhouse.com/docs/en/getting-started/install/
sudo apt install -y apt-transport-https ca-certificates dirmngr
curl -fsSL 'https://packages.clickhouse.com/rpm/lts/repodata/repomd.xml.key' | sudo gpg --dearmor -o /usr/share/keyrings/clickhouse-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg arch=amd64] https://packages.clickhouse.com/deb stable main" | sudo tee /etc/apt/sources.list.d/clickhouse.list
# Adding mariadb repositories (from https://www.linuxcapable.com/how-to-install-mariadb-on-ubuntu-linux/ )
curl -fsSL https://mariadb.org/mariadb_release_signing_key.pgp | sudo gpg --dearmor -o "/usr/share/keyrings/mariadb.gpg"
sudo chmod a+r "/usr/share/keyrings/mariadb.gpg"
# Restore the correct URL after https://jira.mariadb.org/browse/MDBF-651
#echo "deb [arch=amd64,arm64,ppc64el signed-by=/usr/share/keyrings/mariadb.gpg] https://deb.mariadb.org/10.11/ubuntu $(lsb_release -cs) main" \
# | tee /etc/apt/sources.list.d/mariadb.list
echo "deb [arch=amd64,arm64,ppc64el signed-by=/usr/share/keyrings/mariadb.gpg] https://mirror.kumi.systems/mariadb/repo/10.11/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/mariadb.list
# Adding mongodb repositories
wget -qO- https://pgp.mongodb.com/server-7.0.asc | sudo gpg --dearmor | sudo tee /usr/share/keyrings/mongodb-server-7.0.gpg >/dev/null
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" \
| sudo tee -a /etc/apt/sources.list.d/mongodb-org-7.0.list
# Mongo is not officially supported on Ubuntu 24.04, so install it from jammy
- name: Install common deps
run: |
sudo apt update
sudo apt purge -y libpq5 libpq-dev postgresql-*
sudo apt install --allow-downgrades -y clickhouse-common-static redis-server postgresql mongodb-mongosh $(cat scripts/docs/en/deps/${{matrix.os}}.md | tr '\n' ' ')
- name: Setup ccache
run: |
ccache -M 2.0GB
ccache -s -v
- name: Install Kafka
run: |
sudo ./scripts/kafka/ubuntu_install_kafka.sh
- name: Install RabbitMQ packages
run: |
./scripts/rabbitmq/ubuntu_install_rabbitmq_server.sh
- name: Install gdb and pytest
run: |
sudo apt install -y gdb python3-pytest
- name: Run cmake
run: |
cmake -S . -B build_debug ${{matrix.cmake-flags}}
- name: Reconfigure cmake
run: |
cmake -S . -B build_debug ${{matrix.cmake-flags}}
- name: Compile
run: |
pwd
cd build_debug
cmake --build . -j $(nproc)
- name: Save cached directories
uses: actions/cache/save@v6
with:
path: |
${{env.CCACHE_DIR}}
${{env.CPM_SOURCE_CACHE}}
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
- name: Show cache stats
run: |
du -h -d 1 ${{env.CCACHE_DIR}}
du -h -d 1 ${{env.CPM_SOURCE_CACHE}}
ccache -s -v
- name: Run tests
run: |-
echo "UBSAN_OPTIONS=${UBSAN_OPTIONS} ASAN_OPTIONS=${ASAN_OPTIONS}"
cd build_debug
ulimit -n 4096
GTEST_FILTER="${{matrix.tests-flags}}"
export GTEST_FILTER="${GTEST_FILTER#--gtest_filter=}"
# Tests not runnable on the GitHub Ubuntu runner:
# * grpc/mysql: skipped on Ubuntu 24.04 (the only matrix OS)
# * mongo (real DB): mongod replica set does not start on the runner
# * samples-mysql_service: needs mariadb-server (not installed)
# * websocket_client: runner curl lacks ws:// support
# * compile-err-msg: compile-fail test unstable under clang-18
# * ydb (gcc-13 only, YDB enabled there): no ydb server on the runner
excluded_tests=(
userver-grpc-unittest
userver-grpc-benchmark
userver-grpc-tests
userver-grpc-handlers
userver-mysql
userver-mongo-dbtest
testsuite-userver-mongo
userver-samples-mongo
samples-mysql_service
testsuite-userver-core-tests-websocket_client
userver-universal-compile-err-msg-test
userver-ydb
userver-samples-ydb
)
${{matrix.tests-env}} ctest -j2 --output-on-failure \
-E "$(IFS='|'; printf '%s' "${excluded_tests[*]}")"