ci: gh-actions: update linux
[awesomized/libmemcached] / .github / workflows / cmake-build-ci.yml
1 # Generated file; do not edit!
2 name: cmake-build-ci
3 on:
4 workflow_dispatch:
5 release:
6 types: [published]
7 push:
8 paths:
9 - ".github/workflows/cmake-build-ci*"
10 - "CMake*"
11 - "CPack*"
12 - "contrib/**"
13 - "include/**"
14 - "src/**"
15 - "test/**"
16 branches-ignore:
17 - gh-pages
18 pull_request:
19 branches:
20 - master
21 - v1.x
22 env:
23 # defaults
24 INSTALL_MEMCACHED: memcached
25 ENABLE_SASL: "OFF" # ^ almost no memcached distribution package has built in sasl support
26 ENABLE_HASH_HSIEH: "ON"
27 ENABLE_DTRACE: "OFF"
28 OS_VND: Linux #
29 OS_VER: ubuntu-22.04 #
30 CC_VND: gnu #
31 CC_VER: cur #
32
33 jobs:
34
35 # new memcached
36 dbg-new:
37 name: dbg-new (ubuntu-22.04, gnu, cur)
38 runs-on: ubuntu-22.04 #
39 env:
40 CMAKE_BUILD_TYPE: "Debug"
41 BUILD_TESTING: "ON"
42 VERBOSE: "ON"
43 CFLAGS: "-O0 --coverage"
44 CXXFLAGS: "-O0 --coverage"
45 INSTALL_MEMCACHED: ""
46 MEMCACHED_PREFIX: "/tmp"
47 ENABLE_SASL: "ON"
48 steps:
49 - uses: actions/checkout@v2
50 - uses: actions/checkout@v2
51 with:
52 repository: memcached/memcached
53 path: memcached
54 ref: 1.6.7
55 - name: Prepare environment (for cur gnu on ubuntu-22.04)
56 if: (env.OS_VER=='ubuntu-22.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
57 run: |
58 echo CC="gcc-11" >> ${GITHUB_ENV}
59 echo CXX="g++-11" >> ${GITHUB_ENV}
60 - name: Install dependencies (Linux)
61 if: runner.os == 'Linux'
62 run: |
63 sudo apt-get update -y
64 sudo apt-get install -my \
65 libevent-dev \
66 libsasl2-dev \
67 libtbb-dev \
68 python3-sphinx \
69 ${INSTALL_MEMCACHED} \
70 ${INSTALL_CC} ${INSTALL_CXX}
71 sudo systemctl stop memcached || true
72 - name: Build memcached
73 if: runner.os != 'Windows'
74 run: |
75 if test -d memcached
76 then
77 cd memcached
78 ./autogen.sh
79 ./configure CFLAGS="-O2 -pipe" \
80 --prefix=${MEMCACHED_PREFIX} \
81 --enable-sasl \
82 --enable-sasl-pwdb \
83 --disable-coverage \
84 --disable-dependency-tracking \
85 --disable-docs \
86 --disable-extstore \
87 --disable-option-checking \
88 ;
89 make -j2
90 make install
91 cd ..
92 echo MEMCACHED_BINARY="${MEMCACHED_PREFIX}/bin/memcached" >> ${GITHUB_ENV}
93 fi
94 - name: Generate build tree (${{ env.CMAKE_BUILD_TYPE }})
95 run: cmake -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -S . -B build
96 - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
97 run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2
98 - name: Test
99 if: env.BUILD_TESTING == 'ON'
100 run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target test
101 - name: Install
102 if: env.BUILD_TESTING == 'ON'
103 run: cmake --install build --config ${{ env.CMAKE_BUILD_TYPE }} --prefix /tmp
104 - name: Failed tests log
105 if: ${{ env.BUILD_TESTING == 'ON' && failure() }}
106 run: cat build/Testing/Temporary/LastTest.log || true
107 - name: Package
108 env:
109 PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }}
110 if: env.PUSH_ARTIFACTS_ID != '' && env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ')
111 run: |
112 cmake -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -S . -B build
113 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package
114 cmake -DCPACK_COMPONENT_INSTALL=ON build
115 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package
116 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target push-artifacts
117 - name: Notify Gitter
118 env:
119 GITTER: ${{ secrets.GITTER }}
120 if: (success() || failure()) && env.GITTER != ''
121 run: bash .github/notify-gitter.sh ${{ job.status }}
122 - uses: codecov/codecov-action@v1.0.13
123
124 # sanitizer build
125 sanitizer:
126 runs-on: ubuntu-22.04 #
127 strategy:
128 matrix:
129 sanitizer: ['address;undefined', 'thread']
130 env:
131 CMAKE_BUILD_TYPE: "Debug"
132 BUILD_TESTING: "ON"
133 VERBOSE: "ON"
134 ENABLE_SANITIZERS: ${{ matrix.sanitizer }}
135 steps:
136 - uses: actions/checkout@v2
137 - name: Prepare environment (for cur gnu on ubuntu-22.04)
138 if: (env.OS_VER=='ubuntu-22.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
139 run: |
140 echo CC="gcc-11" >> ${GITHUB_ENV}
141 echo CXX="g++-11" >> ${GITHUB_ENV}
142 - name: Install dependencies (Linux)
143 if: runner.os == 'Linux'
144 run: |
145 sudo apt-get update -y
146 sudo apt-get install -my \
147 libevent-dev \
148 libsasl2-dev \
149 libtbb-dev \
150 python3-sphinx \
151 ${INSTALL_MEMCACHED} \
152 ${INSTALL_CC} ${INSTALL_CXX}
153 sudo systemctl stop memcached || true
154 - name: Build memcached
155 if: runner.os != 'Windows'
156 run: |
157 if test -d memcached
158 then
159 cd memcached
160 ./autogen.sh
161 ./configure CFLAGS="-O2 -pipe" \
162 --prefix=${MEMCACHED_PREFIX} \
163 --enable-sasl \
164 --enable-sasl-pwdb \
165 --disable-coverage \
166 --disable-dependency-tracking \
167 --disable-docs \
168 --disable-extstore \
169 --disable-option-checking \
170 ;
171 make -j2
172 make install
173 cd ..
174 echo MEMCACHED_BINARY="${MEMCACHED_PREFIX}/bin/memcached" >> ${GITHUB_ENV}
175 fi
176 - name: Generate build tree (${{ env.CMAKE_BUILD_TYPE }})
177 run: cmake -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -S . -B build
178 - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
179 run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2
180 - name: Test
181 if: env.BUILD_TESTING == 'ON'
182 run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target test
183 - name: Install
184 if: env.BUILD_TESTING == 'ON'
185 run: cmake --install build --config ${{ env.CMAKE_BUILD_TYPE }} --prefix /tmp
186 - name: Failed tests log
187 if: ${{ env.BUILD_TESTING == 'ON' && failure() }}
188 run: cat build/Testing/Temporary/LastTest.log || true
189 - name: Package
190 env:
191 PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }}
192 if: env.PUSH_ARTIFACTS_ID != '' && env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ')
193 run: |
194 cmake -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -S . -B build
195 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package
196 cmake -DCPACK_COMPONENT_INSTALL=ON build
197 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package
198 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target push-artifacts
199 - name: Notify Gitter
200 env:
201 GITTER: ${{ secrets.GITTER }}
202 if: (success() || failure()) && env.GITTER != ''
203 run: bash .github/notify-gitter.sh ${{ job.status }}
204
205 # mac debug
206 dbg-mac:
207 name: dbg-mac (macos-10.15, clang, cur)
208 runs-on: macos-10.15 #
209 env:
210 CMAKE_BUILD_TYPE: "Debug"
211 BUILD_TESTING: "ON"
212 VERBOSE: "ON"
213 CFLAGS: "-O0 --coverage"
214 CXXFLAGS: "-O0 --coverage"
215 OS_VND: macOS #
216 OS_VER: macos-10.15 #
217 CC_VND: clang #
218 CC_VER: cur #
219 continue-on-error: true
220 steps:
221 - uses: actions/checkout@v2
222 - name: Install dependencies (macOS)
223 if: runner.os == 'macOS'
224 run: |
225 brew install bison flex sphinx-doc ${INSTALL_MEMCACHED}
226 brew services stop memcached || true
227 echo MEMCACHED_BINARY="/usr/local/bin/memcached" >> ${GITHUB_ENV}
228 - name: Build memcached
229 if: runner.os != 'Windows'
230 run: |
231 if test -d memcached
232 then
233 cd memcached
234 ./autogen.sh
235 ./configure CFLAGS="-O2 -pipe" \
236 --prefix=${MEMCACHED_PREFIX} \
237 --enable-sasl \
238 --enable-sasl-pwdb \
239 --disable-coverage \
240 --disable-dependency-tracking \
241 --disable-docs \
242 --disable-extstore \
243 --disable-option-checking \
244 ;
245 make -j2
246 make install
247 cd ..
248 echo MEMCACHED_BINARY="${MEMCACHED_PREFIX}/bin/memcached" >> ${GITHUB_ENV}
249 fi
250 - name: Generate build tree (${{ env.CMAKE_BUILD_TYPE }})
251 run: cmake -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -S . -B build
252 - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
253 run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2
254 - name: Test
255 if: env.BUILD_TESTING == 'ON'
256 run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target test
257 - name: Install
258 if: env.BUILD_TESTING == 'ON'
259 run: cmake --install build --config ${{ env.CMAKE_BUILD_TYPE }} --prefix /tmp
260 - name: Failed tests log
261 if: ${{ env.BUILD_TESTING == 'ON' && failure() }}
262 run: cat build/Testing/Temporary/LastTest.log || true
263 - name: Package
264 env:
265 PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }}
266 if: env.PUSH_ARTIFACTS_ID != '' && env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ')
267 run: |
268 cmake -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -S . -B build
269 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package
270 cmake -DCPACK_COMPONENT_INSTALL=ON build
271 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package
272 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target push-artifacts
273 - name: Notify Gitter
274 env:
275 GITTER: ${{ secrets.GITTER }}
276 if: (success() || failure()) && env.GITTER != ''
277 run: bash .github/notify-gitter.sh ${{ job.status }}
278 - uses: codecov/codecov-action@v1.0.13
279
280 # mac release
281 rel-mac:
282 name: rel-mac (macos-10.15, clang, cur)
283 runs-on: macos-10.15 #
284 env:
285 CMAKE_BUILD_TYPE: "Release"
286 BUILD_DOCS_MANGZ: "ON"
287 OS_VND: macOS #
288 OS_VER: macos-10.15 #
289 CC_VND: clang #
290 CC_VER: cur #
291 continue-on-error: true
292 steps:
293 - uses: actions/checkout@v2
294 with:
295 fetch-depth: 0
296 - name: Install dependencies (macOS)
297 if: runner.os == 'macOS'
298 run: |
299 brew install bison flex sphinx-doc ${INSTALL_MEMCACHED}
300 brew services stop memcached || true
301 echo MEMCACHED_BINARY="/usr/local/bin/memcached" >> ${GITHUB_ENV}
302 - name: Build memcached
303 if: runner.os != 'Windows'
304 run: |
305 if test -d memcached
306 then
307 cd memcached
308 ./autogen.sh
309 ./configure CFLAGS="-O2 -pipe" \
310 --prefix=${MEMCACHED_PREFIX} \
311 --enable-sasl \
312 --enable-sasl-pwdb \
313 --disable-coverage \
314 --disable-dependency-tracking \
315 --disable-docs \
316 --disable-extstore \
317 --disable-option-checking \
318 ;
319 make -j2
320 make install
321 cd ..
322 echo MEMCACHED_BINARY="${MEMCACHED_PREFIX}/bin/memcached" >> ${GITHUB_ENV}
323 fi
324 - name: Generate build tree (${{ env.CMAKE_BUILD_TYPE }})
325 run: cmake -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -S . -B build
326 - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
327 run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2
328 - name: Test
329 if: env.BUILD_TESTING == 'ON'
330 run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target test
331 - name: Install
332 if: env.BUILD_TESTING == 'ON'
333 run: cmake --install build --config ${{ env.CMAKE_BUILD_TYPE }} --prefix /tmp
334 - name: Failed tests log
335 if: ${{ env.BUILD_TESTING == 'ON' && failure() }}
336 run: cat build/Testing/Temporary/LastTest.log || true
337 - name: Package
338 env:
339 PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }}
340 if: env.PUSH_ARTIFACTS_ID != '' && env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ')
341 run: |
342 cmake -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -S . -B build
343 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package
344 cmake -DCPACK_COMPONENT_INSTALL=ON build
345 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package
346 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target push-artifacts
347 - name: Notify Gitter
348 env:
349 GITTER: ${{ secrets.GITTER }}
350 if: (success() || failure()) && env.GITTER != ''
351 run: bash .github/notify-gitter.sh ${{ job.status }}
352
353 # windows release builds
354 windows:
355 strategy:
356 fail-fast: false
357 matrix:
358 os_ver: [windows-2019]
359 cc_vnd: [msvc, mingw]
360 cc_ver: [cur]
361 runs-on: ${{ matrix.os_ver }}
362 continue-on-error: true
363 env:
364 CMAKE_BUILD_TYPE: "Release"
365 OS_VND: Windows
366 OS_VER: ${{ matrix.os_ver }}
367 CC_VND: ${{ matrix.cc_vnd }}
368 CC_VER: ${{ matrix.cc_ver }}
369 steps:
370 - uses: actions/checkout@v2
371 with:
372 fetch-depth: 0
373 - name: Prepare environment (Windows)
374 run: |
375 echo "c:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
376 echo "c:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
377 echo 'CMAKE_GENERATOR=Visual Studio 16 2019' | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
378 - name: Prepare environment (MinGW)
379 if: env.CC_VND == 'mingw'
380 run: |
381 echo 'CMAKE_GENERATOR=MinGW Makefiles' | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
382 - name: Install dependencies (Windows)
383 if: runner.os == 'Windows'
384 uses: msys2/setup-msys2@v2
385 with:
386 release: false
387 path-type: inherit
388 install: >-
389 rsync
390 openssh
391 - name: Generate build tree (${{ env.CMAKE_BUILD_TYPE }})
392 run: cmake -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -S . -B build
393 - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
394 run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2
395 - name: Test
396 if: env.BUILD_TESTING == 'ON'
397 run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target test
398 - name: Install
399 if: env.BUILD_TESTING == 'ON'
400 run: cmake --install build --config ${{ env.CMAKE_BUILD_TYPE }} --prefix /tmp
401 - name: Failed tests log
402 if: ${{ env.BUILD_TESTING == 'ON' && failure() }}
403 run: cat build/Testing/Temporary/LastTest.log || true
404 - name: Package
405 env:
406 PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }}
407 if: env.PUSH_ARTIFACTS_ID != '' && env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ')
408 run: |
409 cmake -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -S . -B build
410 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package
411 cmake -DCPACK_COMPONENT_INSTALL=ON build
412 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package
413 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target push-artifacts
414 - name: Notify Gitter
415 env:
416 GITTER: ${{ secrets.GITTER }}
417 if: (success() || failure()) && env.GITTER != ''
418 run: bash .github/notify-gitter.sh ${{ job.status }}
419
420 # linux release builds
421 release:
422 strategy:
423 fail-fast: false
424 matrix:
425 os_ver: [ubuntu-20.04, ubuntu-18.04]
426 cc_vnd: [gnu, clang]
427 cc_ver: [new, cur, old]
428 runs-on: ${{ matrix.os_ver }}
429 continue-on-error: ${{ matrix.cc_vnd == 'clang' }}
430 env:
431 CMAKE_BUILD_TYPE: "Release"
432 BUILD_DOCS_MANGZ: "ON"
433 OS_VND: Linux
434 OS_VER: ${{ matrix.os_ver }}
435 CC_VND: ${{ matrix.cc_vnd }}
436 CC_VER: ${{ matrix.cc_ver }}
437 steps:
438 - uses: actions/checkout@v2
439 with:
440 fetch-depth: 0
441 - name: Prepare environment (for new gnu on ubuntu-22.04)
442 if: (env.OS_VER=='ubuntu-22.04') && (env.CC_VND=='gnu') && (env.CC_VER=='new')
443 run: |
444 echo CC="gcc-12" >> ${GITHUB_ENV}
445 echo CXX="g++-12" >> ${GITHUB_ENV}
446 - name: Prepare environment (for cur gnu on ubuntu-22.04)
447 if: (env.OS_VER=='ubuntu-22.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
448 run: |
449 echo CC="gcc-11" >> ${GITHUB_ENV}
450 echo CXX="g++-11" >> ${GITHUB_ENV}
451 - name: Prepare environment (for old gnu on ubuntu-22.04)
452 if: (env.OS_VER=='ubuntu-22.04') && (env.CC_VND=='gnu') && (env.CC_VER=='old')
453 run: |
454 echo CC="gcc-10" >> ${GITHUB_ENV}
455 echo CXX="g++-10" >> ${GITHUB_ENV}
456 - name: Prepare environment (for new clang on ubuntu-22.04)
457 if: (env.OS_VER=='ubuntu-22.04') && (env.CC_VND=='clang') && (env.CC_VER=='new')
458 run: |
459 echo CC="clang-14" >> ${GITHUB_ENV}
460 echo CXX="clang++-14" >> ${GITHUB_ENV}
461 echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV}
462 echo INSTALL_CXX="libc++-14-dev libc++abi-14-dev" >> ${GITHUB_ENV}
463 - name: Prepare environment (for cur clang on ubuntu-22.04)
464 if: (env.OS_VER=='ubuntu-22.04') && (env.CC_VND=='clang') && (env.CC_VER=='cur')
465 run: |
466 echo CC="clang-13" >> ${GITHUB_ENV}
467 echo CXX="clang++-13" >> ${GITHUB_ENV}
468 echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV}
469 echo INSTALL_CXX="libc++-13-dev libc++abi-13-dev" >> ${GITHUB_ENV}
470 - name: Prepare environment (for old clang on ubuntu-22.04)
471 if: (env.OS_VER=='ubuntu-22.04') && (env.CC_VND=='clang') && (env.CC_VER=='old')
472 run: |
473 echo CC="clang-12" >> ${GITHUB_ENV}
474 echo CXX="clang++-12" >> ${GITHUB_ENV}
475 echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV}
476 echo INSTALL_CXX="libc++-12-dev libc++abi-12-dev" >> ${GITHUB_ENV}
477 - name: Prepare environment (for new gnu on ubuntu-20.04)
478 if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='new')
479 run: |
480 echo CC="gcc-10" >> ${GITHUB_ENV}
481 echo CXX="g++-10" >> ${GITHUB_ENV}
482 - name: Prepare environment (for cur gnu on ubuntu-20.04)
483 if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
484 run: |
485 echo CC="gcc-9" >> ${GITHUB_ENV}
486 echo CXX="g++-9" >> ${GITHUB_ENV}
487 - name: Prepare environment (for new clang on ubuntu-20.04)
488 if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='clang') && (env.CC_VER=='new')
489 run: |
490 echo CC="clang-12" >> ${GITHUB_ENV}
491 echo CXX="clang++-12" >> ${GITHUB_ENV}
492 echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV}
493 echo INSTALL_CXX="libc++-12-dev libc++abi-12-dev" >> ${GITHUB_ENV}
494 - name: Prepare environment (for cur clang on ubuntu-20.04)
495 if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='clang') && (env.CC_VER=='cur')
496 run: |
497 echo CC="clang-11" >> ${GITHUB_ENV}
498 echo CXX="clang++-11" >> ${GITHUB_ENV}
499 echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV}
500 echo INSTALL_CXX="libc++-11-dev libc++abi-11-dev" >> ${GITHUB_ENV}
501 - name: Prepare environment (for old clang on ubuntu-20.04)
502 if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='clang') && (env.CC_VER=='old')
503 run: |
504 echo CC="clang-10" >> ${GITHUB_ENV}
505 echo CXX="clang++-10" >> ${GITHUB_ENV}
506 echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV}
507 echo INSTALL_CXX="libc++-10-dev libc++abi-10-dev" >> ${GITHUB_ENV}
508 - name: Prepare environment (for new gnu on ubuntu-18.04)
509 if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='gnu') && (env.CC_VER=='new')
510 run: |
511 echo CC="gcc-10" >> ${GITHUB_ENV}
512 echo CXX="g++-10" >> ${GITHUB_ENV}
513 - name: Prepare environment (for cur gnu on ubuntu-18.04)
514 if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='gnu') && (env.CC_VER=='cur')
515 run: |
516 echo CC="gcc-9" >> ${GITHUB_ENV}
517 echo CXX="g++-9" >> ${GITHUB_ENV}
518 - name: Prepare environment (for old gnu on ubuntu-18.04)
519 if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='gnu') && (env.CC_VER=='old')
520 run: |
521 echo CC="gcc-7" >> ${GITHUB_ENV}
522 echo CXX="g++-7" >> ${GITHUB_ENV}
523 - name: Prepare environment (for cur clang on ubuntu-18.04)
524 if: (env.OS_VER=='ubuntu-18.04') && (env.CC_VND=='clang') && (env.CC_VER=='cur')
525 run: |
526 echo CC="clang-9" >> ${GITHUB_ENV}
527 echo CXX="clang++-9" >> ${GITHUB_ENV}
528 echo CXXFLAGS="-stdlib=libc++" >> ${GITHUB_ENV}
529 - name: Install dependencies (Linux)
530 if: runner.os == 'Linux'
531 run: |
532 sudo apt-get update -y
533 sudo apt-get install -my \
534 libevent-dev \
535 libsasl2-dev \
536 libtbb-dev \
537 python3-sphinx \
538 ${INSTALL_MEMCACHED} \
539 ${INSTALL_CC} ${INSTALL_CXX}
540 sudo systemctl stop memcached || true
541 - name: Build memcached
542 if: runner.os != 'Windows'
543 run: |
544 if test -d memcached
545 then
546 cd memcached
547 ./autogen.sh
548 ./configure CFLAGS="-O2 -pipe" \
549 --prefix=${MEMCACHED_PREFIX} \
550 --enable-sasl \
551 --enable-sasl-pwdb \
552 --disable-coverage \
553 --disable-dependency-tracking \
554 --disable-docs \
555 --disable-extstore \
556 --disable-option-checking \
557 ;
558 make -j2
559 make install
560 cd ..
561 echo MEMCACHED_BINARY="${MEMCACHED_PREFIX}/bin/memcached" >> ${GITHUB_ENV}
562 fi
563 - name: Generate build tree (${{ env.CMAKE_BUILD_TYPE }})
564 run: cmake -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -S . -B build
565 - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
566 run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2
567 - name: Test
568 if: env.BUILD_TESTING == 'ON'
569 run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target test
570 - name: Install
571 if: env.BUILD_TESTING == 'ON'
572 run: cmake --install build --config ${{ env.CMAKE_BUILD_TYPE }} --prefix /tmp
573 - name: Failed tests log
574 if: ${{ env.BUILD_TESTING == 'ON' && failure() }}
575 run: cat build/Testing/Temporary/LastTest.log || true
576 - name: Package
577 env:
578 PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }}
579 if: env.PUSH_ARTIFACTS_ID != '' && env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ')
580 run: |
581 cmake -DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -S . -B build
582 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package
583 cmake -DCPACK_COMPONENT_INSTALL=ON build
584 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package
585 cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target push-artifacts
586 - name: Notify Gitter
587 env:
588 GITTER: ${{ secrets.GITTER }}
589 if: (success() || failure()) && env.GITTER != ''
590 run: bash .github/notify-gitter.sh ${{ job.status }}