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",
34 "INSTALL_CC" => "gcc-10",
35 "INSTALL_CXX" => "g++-10",
42 "CXXFLAGS" => "-stdlib=libc++"
98 * @var bool $splat_map false = no splat map, null = default splat map, true = full splat map
100 function steps_setenv($splat_map = null) {
101 if ($splat_map !== false) {
102 foreach (MAP
as $os_is => $os_vers) {
103 foreach ($os_vers as $os_ver => $cc_vnds_) {
104 if (!$splat_map && DEF
[DEF
["os"]] != $os_ver) continue;
105 foreach ($cc_vnds_ as $cc_vnd_is => $cc_vnds) {
106 foreach ($cc_vnds as $cc_vnd => $cc_vers_) {
107 if (!$splat_map && DEF
[DEF
[DEF
["os"]]] != $cc_vnd) continue;
108 foreach ($cc_vers_ as $cc_ver_is => $cc_vers) {
109 foreach ($cc_vers as $cc_ver => $ver) {
110 if (!$splat_map && DEF
[DEF
[DEF
[DEF
["os"]]]]["ver"] != $cc_ver) continue;
112 - name
: Prepare
environment (<?
= "for $cc_ver $cc_vnd on $os_ver" ?
>)
113 if: (<?
="$os_is=='$os_ver') && ($cc_vnd_is=='$cc_vnd') && ($cc_ver_is=='$cc_ver'"?
>)
115 echo CC
="<?=DEF[$cc_vnd]["CC
"] . $ver?>" >> $
{GITHUB_ENV
}
116 echo CXX
="<?=DEF[$cc_vnd]["CXX
"] . $ver?>" >> $
{GITHUB_ENV
}
118 if (isset(ENV
[$os_ver][$cc_vnd][$cc_ver])) {
119 foreach (ENV
[$os_ver][$cc_vnd][$cc_ver] as $env => $val) {
121 echo <?
=$env?
>="<?=$val?>" >> $
{GITHUB_ENV
}
134 function steps_getdeps() {
136 - name
: Install
dependencies (Linux
)
137 if: runner
.os
== 'Linux'
139 sudo apt
-get install \
143 $
{INSTALL_MEMCACHED
} \
144 $
{INSTALL_CC
} $
{INSTALL_CXX
}
145 sudo systemctl stop memcached ||
true
146 - name
: Install
dependencies (Mac
)
147 if: runner
.os
== 'macOS'
149 brew install bison flex $
{INSTALL_MEMCACHED
}
150 brew services stop memcached ||
true
151 echo MEMCACHED_BINARY
="/usr/local/bin/memcached" >> $
{GITHUB_ENV
}
152 - name
: Build memcached
158 ./configure CFLAGS
="-O2 -pipe" \
159 --prefix
=$
{MEMCACHED_PREFIX
} \
163 --disable
-dependency
-tracking \
166 --disable
-option
-checking \
171 echo MEMCACHED_BINARY
="${MEMCACHED_PREFIX}/bin/memcached" >> $
{GITHUB_ENV
}
176 function steps_build() {
178 - name
: Generate build
tree ($
{{ env
.CMAKE_BUILD_TYPE
}})
179 run
: cmake
-S
. -B build
180 - name
: Build all with $
{{ env
.CXX
}} $
{{ env
.CXXFLAGS
}}
181 run
: make
-C build
-j2 all
183 run
: make
-C build
-j2 test
185 run
: make
-C build
-j2 install DESTDIR
=/tmp
186 - name
: Failed tests log
188 run
: cat build
/Testing
/Temporary
/LastTest
.log ||
true
192 function steps_notify() {
194 - name
: Notify
Gitter (success
)
197 REF
=$
(basename $
{GITHUB_REF
})
198 curl
-sS
"${{ secrets.GITTER }}" \
199 --data
-urlencode
"level=info" \
200 --data
-urlencode
"message=Github [${GITHUB_REPOSITORY}](https://github.com/${GITHUB_REPOSITORY}/commits/${REF}) (${REF}) [success](https://github.com/m6w6/libmemcached/actions/runs/${GITHUB_RUN_ID}) (${ImageOS}/${CC:-${CC_VND}-${CC_VER}})"
201 - name
: Notify
Gitter (failure
)
204 REF
=$
(basename $
{GITHUB_REF
})
205 curl
-sS
"${{ secrets.GITTER }}" \
206 --data
-urlencode
"level=error" \
207 --data
-urlencode
"message=Github [${GITHUB_REPOSITORY}](https://github.com/${GITHUB_REPOSITORY}/commits/${REF}) (${REF}) [failure](https://github.com/m6w6/libmemcached/actions/runs/${GITHUB_RUN_ID}) (${ImageOS}/${CC:-${CC_VND}-${CC_VER}})"
211 function steps($splat_map = null) {
212 steps_setenv($splat_map);
218 function defaults() {
219 $os_ver = DEF
[DEF
["os"]];
220 $cc_vnd = DEF
[$os_ver];
221 $cc_ver = DEF
[$cc_vnd]["ver"];
222 return "$os_ver, $cc_vnd, $cc_ver";
233 - ".github/workflows/cmake-build-ci*"
242 INSTALL_MEMCACHED
: memcached
243 CMAKE_BUILD_TYPE
: Debug
246 ENABLE_HASH_HSIEH
: "ON"
249 OS_VND
: <?
=DEF
["os"]?
> #
250 OS_VER
: <?
=DEF
[DEF
["os"]]?
> #
251 CC_VND
: <?
=DEF
[DEF
[DEF
["os"]]]?
> #
252 CC_VER
: <?
=DEF
[DEF
[DEF
[DEF
["os"]]]]["ver"]?
> #
258 name
: dbg
-new (<?
=defaults()?
>)
259 runs
-on
: <?
=DEF
[DEF
["os"]]?
> #
262 MEMCACHED_PREFIX
: /tmp
264 CFLAGS
: "-O0 --coverage"
265 CXXFLAGS
: "-O0 --coverage"
267 - uses
: actions
/checkout@v2
268 - uses
: actions
/checkout@v2
270 repository
: memcached
/memcached
274 - uses
: codecov
/codecov
-action@v1
.0
.13
278 name
: dbg
-san (<?
=defaults()?
>)
279 runs
-on
: <?
=DEF
[DEF
["os"]]?
> #
281 ENABLE_SANITIZERS
: "address;undefined"
283 - uses
: actions
/checkout@v2
286 # thread sanitizer build
288 name
: dbg
-tsan (<?
=defaults()?
>)
289 runs
-on
: <?
=DEF
[DEF
["os"]]?
> #
291 ENABLE_SANITIZERS
: "thread"
293 - uses
: actions
/checkout@v2
298 name
: dbg
-mac (<?
=DEF
["macOS"]?
>, <?
=DEF
[DEF
["macOS"]]?
>, <?
=DEF
[DEF
[DEF
["macOS"]]]["ver"]?
>)
299 runs
-on
: <?
=DEF
["macOS"]?
> #
301 CFLAGS
: -O0
--coverage
302 CXXFLAGS
: -O0
--coverage
304 OS_VER
: <?
=DEF
["macOS"]?
> #
305 CC_VND
: <?
=DEF
[DEF
["macOS"]]?
> #
306 CC_VER
: <?
=DEF
[DEF
[DEF
["macOS"]]]["ver"]?
> #
307 continue-on
-error
: true
309 - uses
: actions
/checkout@v2
310 <?php
steps(false); ?
>
311 - uses
: codecov
/codecov
-action@v1
.0
.13
315 name
: win
-msvc (<?
=DEF
["Windows"]?
>, <?
=DEF
[DEF
["Windows"]]?
>, <?
=DEF
[DEF
[DEF
["Windows"]]]["ver"]?
>)
316 runs
-on
: <?
=DEF
["Windows"]?
> #
318 CMAKE_BUILD_TYPE
: Release
320 BISON_ROOT
: "C:/msys64/usr"
321 FLEX_ROOT
: "C:/msys64/usr"
323 OS_VER
: <?
=DEF
["Windows"]?
> #
324 CC_VND
: <?
=DEF
[DEF
["Windows"]]?
> #
325 CC_VER
: <?
=DEF
[DEF
[DEF
["Windows"]]]["ver"]?
> #
326 continue-on
-error
: true
328 - uses
: actions
/checkout@v2
329 - name
: Generate build
tree ($
{{ env
.CMAKE_BUILD_TYPE
}})
330 run
: cmake
--config $
{{ env
.CMAKE_BUILD_TYPE
}} -S
. -B build
331 - name
: Build all with $
{{ env
.CC_VND
}}
332 run
: cmake
--build build
--config $
{{ env
.CMAKE_BUILD_TYPE
}}
334 run
: cmake
--install build
--prefix installed
--config $
{{ env
.CMAKE_BUILD_TYPE
}}
341 os_ver
: [ubuntu
-20.04, ubuntu
-18.04]
343 cc_ver
: [new, cur
, old
]
344 runs
-on
: $
{{ matrix
.os_ver
}}
345 continue-on
-error
: $
{{ matrix
.cc_vnd
== 'clang' }}
347 CMAKE_BUILD_TYPE
: Release
349 OS_VER
: $
{{ matrix
.os_ver
}}
350 CC_VND
: $
{{ matrix
.cc_vnd
}}
351 CC_VER
: $
{{ matrix
.cc_ver
}}
353 - uses
: actions
/checkout@v2
354 <?php
steps(true); ?
>