4 echo "# Generated file; do not edit!\n";
8 "Linux" => "ubuntu-20.04",
9 "Windows" => "windows-2019",
10 "macOS" => "macos-10.15",
11 "ubuntu-20.04" => "gnu",
12 "windows-2019" => "msvc",
13 "macos-10.15" => "clang",
79 "INSTALL_CC" => "gcc-10",
80 "INSTALL_CXX" => "g++-10",
85 "CXXFLAGS" => "-stdlib=libc++"
88 "CXXFLAGS" => "-stdlib=libc++",
89 "INSTALL_CXX" => "libc++"
90 . MAP
["env.OS_VER"]["ubuntu-20.04"]["env.CC_VND"]["clang"]["env.CC_VER"]["cur"] . "-dev"
93 "CXXFLAGS" => "-stdlib=libc++",
94 "INSTALL_CXX" => "libc++"
95 . MAP
["env.OS_VER"]["ubuntu-20.04"]["env.CC_VND"]["clang"]["env.CC_VER"]["old"] . "-dev"
102 "CXXFLAGS" => "-stdlib=libc++"
105 "CXXFLAGS" => "-stdlib=libc++"
108 "CXXFLAGS" => "-stdlib=libc++"
115 * @var bool $splat_map false = no splat map, null = default splat map, true = full splat map
117 function steps_setenv($os_vnd, $splat_map = null) {
118 if ($os_vnd === "Windows") {
120 - name
: Prepare
environment (Windows
)
122 echo "c:\msys64\usr\bin" | Out
-File
-FilePath
$env:GITHUB_PATH
-Encoding utf8
-Append
123 echo "c:\msys64\mingw64\bin" | Out
-File
-FilePath
$env:GITHUB_PATH
-Encoding utf8
-Append
124 - name
: Prepare
environment (MinGW
)
125 if: env
.CC_VND
== 'mingw'
127 echo 'CMAKE_GENERATOR=MinGW Makefiles' | Out
-File
-FilePath
$env:GITHUB_ENV
-Encoding utf8
-Append
129 } elseif ($splat_map !== false) {
130 foreach (MAP
as $os_is => $os_vers) {
131 foreach ($os_vers as $os_ver => $cc_vnds_) {
132 if (!$splat_map && DEF
[DEF
["os"]] != $os_ver) continue;
133 foreach ($cc_vnds_ as $cc_vnd_is => $cc_vnds) {
134 foreach ($cc_vnds as $cc_vnd => $cc_vers_) {
135 if (!$splat_map && DEF
[DEF
[DEF
["os"]]] != $cc_vnd) continue;
136 foreach ($cc_vers_ as $cc_ver_is => $cc_vers) {
137 foreach ($cc_vers as $cc_ver => $ver) {
138 if (!$splat_map && DEF
[DEF
[DEF
[DEF
["os"]]]]["ver"] != $cc_ver) continue;
140 - name
: Prepare
environment (<?
= "for $cc_ver $cc_vnd on $os_ver" ?
>)
141 if: (<?
="$os_is=='$os_ver') && ($cc_vnd_is=='$cc_vnd') && ($cc_ver_is=='$cc_ver'"?
>)
143 echo CC
="<?=DEF[$cc_vnd]["CC
"] . $ver?>" >> $
{GITHUB_ENV
}
144 echo CXX
="<?=DEF[$cc_vnd]["CXX
"] . $ver?>" >> $
{GITHUB_ENV
}
146 if (isset(ENV
[$os_ver][$cc_vnd][$cc_ver])) {
147 foreach (ENV
[$os_ver][$cc_vnd][$cc_ver] as $env => $val) {
149 echo <?
=$env?
>="<?=$val?>" >> $
{GITHUB_ENV
}
162 function steps_getdeps($os_vnd) {
164 - name
: Install
dependencies (<?
=$os_vnd?
>)
165 if: runner
.os
== '<?=$os_vnd?>'
167 if ($os_vnd === "Linux") :
170 sudo apt
-get install
-my \
175 $
{INSTALL_MEMCACHED
} \
176 $
{INSTALL_CC
} $
{INSTALL_CXX
}
177 sudo systemctl stop memcached ||
true
180 if ($os_vnd === "macOS") :
183 brew install bison flex sphinx
-doc $
{INSTALL_MEMCACHED
}
184 brew services stop memcached ||
true
185 echo MEMCACHED_BINARY
="/usr/local/bin/memcached" >> $
{GITHUB_ENV
}
188 if ($os_vnd === "Windows") :
190 uses
: msys2
/setup
-msys2@v2
199 if ($os_vnd != "Windows") :
201 - name
: Build memcached
202 if: runner
.os
!= 'Windows'
208 ./configure CFLAGS
="-O2 -pipe" \
209 --prefix
=$
{MEMCACHED_PREFIX
} \
213 --disable
-dependency
-tracking \
216 --disable
-option
-checking \
221 echo MEMCACHED_BINARY
="${MEMCACHED_PREFIX}/bin/memcached" >> $
{GITHUB_ENV
}
227 function steps_build() {
229 - name
: Generate build
tree ($
{{ env
.CMAKE_BUILD_TYPE
}})
230 run
: cmake
--config $
{{ env
.CMAKE_BUILD_TYPE
}} -S
. -B build
231 - name
: Build all with $
{{ env
.CXX
}} $
{{ env
.CXXFLAGS
}}
232 run
: cmake
--build build
--config $
{{ env
.CMAKE_BUILD_TYPE
}} -j2
236 function steps_test() {
239 if: env
.BUILD_TESTING
== 'ON'
240 run
: cmake
--build build
--config $
{{ env
.CMAKE_BUILD_TYPE
}} -j2
--target test
242 if: env
.BUILD_TESTING
== 'ON'
243 run
: cmake
--install build
--config $
{{ env
.CMAKE_BUILD_TYPE
}} --prefix
/tmp
244 - name
: Failed tests log
245 if: $
{{ env
.BUILD_TESTING
== 'ON' && failure() }}
246 run
: cat build
/Testing
/Temporary
/LastTest
.log ||
true
250 function steps_package() {
254 PUSH_ARTIFACTS_ID
: $
{{ secrets
.PUSH_ARTIFACTS_ID
}}
255 if: env
.CMAKE_BUILD_TYPE
== 'Release' && !(env
.OS_VER
== 'ubuntu-18.04' && env
.CC_VND
== 'gnu' && env
.CC_VER
== 'new ')
257 cmake
--config $
{{ env
.CMAKE_BUILD_TYPE
}} -S
. -B build
258 cmake
--build build
--config $
{{ env
.CMAKE_BUILD_TYPE
}} -j2
--target package
259 cmake
-DCPACK_COMPONENT_INSTALL
=ON build
260 cmake
--build build
--config $
{{ env
.CMAKE_BUILD_TYPE
}} -j2
--target package
261 cmake
--build build
--config $
{{ env
.CMAKE_BUILD_TYPE
}} -j2
--target push
-artifacts
265 function steps_notify($os_vnd) {
267 - name
: Notify Gitter
268 run
: bash
.github
/notify
-gitter
.sh $
{{ secrets
.GITTER
}} $
{{ job
.status
}}
272 function steps($os_vnd, $splat_map = null) {
273 steps_setenv($os_vnd, $splat_map);
274 steps_getdeps($os_vnd);
278 steps_notify($os_vnd);
281 function defaults($os_vnd = DEF
["os"]) {
282 $os_ver = DEF
[$os_vnd];
283 $cc_vnd = DEF
[$os_ver];
284 $cc_ver = DEF
[$cc_vnd]["ver"];
285 return "$os_ver, $cc_vnd, $cc_ver";
288 function env_override($os_vnd, $cc_vnd = null) {
289 isset($cc_vnd) or $cc_vnd = DEF
[DEF
[$os_vnd]];
291 OS_VND
: <?
=$os_vnd?
> #
292 OS_VER
: <?
=DEF
[$os_vnd]?
> #
293 CC_VND
: <?
=$cc_vnd?
> #
294 CC_VER
: <?
=DEF
[$cc_vnd]["ver"]?
> #
309 - ".github/workflows/cmake-build-ci*"
318 INSTALL_MEMCACHED
: memcached
319 ENABLE_SASL
: "OFF" # ^ almost no memcached distribution package has built in sasl support
320 ENABLE_HASH_HSIEH
: "ON"
322 OS_VND
: <?
=DEF
["os"]?
> #
323 OS_VER
: <?
=DEF
[DEF
["os"]]?
> #
324 CC_VND
: <?
=DEF
[DEF
[DEF
["os"]]]?
> #
325 CC_VER
: <?
=DEF
[DEF
[DEF
[DEF
["os"]]]]["ver"]?
> #
331 name
: dbg
-new (<?
=defaults()?
>)
332 runs
-on
: <?
=DEF
[DEF
["os"]]?
> #
334 CMAKE_BUILD_TYPE
: "Debug"
337 CFLAGS
: "-O0 --coverage"
338 CXXFLAGS
: "-O0 --coverage"
339 INSTALL_MEMCACHED
: ""
340 MEMCACHED_PREFIX
: "/tmp"
343 - uses
: actions
/checkout@v2
344 - uses
: actions
/checkout@v2
346 repository
: memcached
/memcached
349 <?php
steps("Linux"); ?
>
350 - uses
: codecov
/codecov
-action@v1
.0
.13
354 runs
-on
: <?
=DEF
[DEF
["os"]]?
> #
357 sanitizer
: ['address;undefined', 'thread']
359 CMAKE_BUILD_TYPE
: "Debug"
362 ENABLE_SANITIZERS
: $
{{ matrix
.sanitizer
}}
364 - uses
: actions
/checkout@v2
365 <?php
steps("Linux"); ?
>
369 name
: dbg
-mac (<?
=DEF
["macOS"]?
>, <?
=DEF
[DEF
["macOS"]]?
>, <?
=DEF
[DEF
[DEF
["macOS"]]]["ver"]?
>)
370 runs
-on
: <?
=DEF
["macOS"]?
> #
372 CMAKE_BUILD_TYPE
: "Debug"
375 CFLAGS
: "-O0 --coverage"
376 CXXFLAGS
: "-O0 --coverage"
377 <?php
env_override("macOS")?
>
378 continue-on
-error
: true
380 - uses
: actions
/checkout@v2
381 <?php
steps("macOS", false); ?
>
382 - uses
: codecov
/codecov
-action@v1
.0
.13
386 name
: rel
-mac (<?
=DEF
["macOS"]?
>, <?
=DEF
[DEF
["macOS"]]?
>, <?
=DEF
[DEF
[DEF
["macOS"]]]["ver"]?
>)
387 runs
-on
: <?
=DEF
["macOS"]?
> #
389 CMAKE_BUILD_TYPE
: "Release"
390 BUILD_DOCS_MANGZ
: "ON"
391 <?php
env_override("macOS")?
>
392 continue-on
-error
: true
394 - uses
: actions
/checkout@v2
397 <?php
steps("macOS", false); ?
>
399 # windows release builds
404 os_ver
: [<?
=DEF
["Windows"]?
>]
405 cc_vnd
: [msvc
, mingw
]
407 runs
-on
: $
{{ matrix
.os_ver
}}
408 continue-on
-error
: true
410 CMAKE_BUILD_TYPE
: "Release"
412 OS_VER
: $
{{ matrix
.os_ver
}}
413 CC_VND
: $
{{ matrix
.cc_vnd
}}
414 CC_VER
: $
{{ matrix
.cc_ver
}}
416 - uses
: actions
/checkout@v2
419 <?php
steps("Windows", true); ?
>
421 # linux release builds
426 os_ver
: [ubuntu
-20.04, ubuntu
-18.04]
428 cc_ver
: [new, cur
, old
]
429 runs
-on
: $
{{ matrix
.os_ver
}}
430 continue-on
-error
: $
{{ matrix
.cc_vnd
== 'clang' }}
432 CMAKE_BUILD_TYPE
: "Release"
433 BUILD_DOCS_MANGZ
: "ON"
435 OS_VER
: $
{{ matrix
.os_ver
}}
436 CC_VND
: $
{{ matrix
.cc_vnd
}}
437 CC_VER
: $
{{ matrix
.cc_ver
}}
439 - uses
: actions
/checkout@v2
442 <?php
steps("Linux", true); ?
>