4 echo "# Generated file; do not edit!\n";
9 "Linux" => "ubuntu-20.04",
10 "macOS" => "macos-10.15",
11 "ubuntu-20.04" => "gnu",
12 "macos-10.15" => "clang",
84 * @var bool $splat_map false = no splat map, null = default splat map, true = full splat map
86 function steps_setenv($splat_map = null) {
87 if ($splat_map !== false) {
88 foreach (MAP
as $os_is => $os_vers) {
89 foreach ($os_vers as $os_ver => $cc_vnds_) {
90 if (!$splat_map && DEF
[DEF
["os"]] != $os_ver) continue;
91 foreach ($cc_vnds_ as $cc_vnd_is => $cc_vnds) {
92 foreach ($cc_vnds as $cc_vnd => $cc_vers_) {
93 if (!$splat_map && DEF
[DEF
[DEF
["os"]]] != $cc_vnd) continue;
94 foreach ($cc_vers_ as $cc_ver_is => $cc_vers) {
95 foreach ($cc_vers as $cc_ver => $ver) {
96 if (!$splat_map && DEF
[DEF
[DEF
[DEF
["os"]]]]["ver"] != $cc_ver) continue;
98 <?
=PRE?
> - name
: Prepare
environment (<?
= "for $cc_ver $cc_vnd on $os_ver" ?
>)
99 <?
=PRE?
> if: (<?
="$os_is=='$os_ver') && ($cc_vnd_is=='$cc_vnd') && ($cc_ver_is=='$cc_ver'"?
>)
101 <?
=PRE?
> echo CC
=<?
=DEF
[$cc_vnd]["CC"] . $ver?
> >> $
{GITHUB_ENV
}
102 <?
=PRE?
> echo CXX
=<?
=DEF
[$cc_vnd]["CXX"] . $ver?
> >> $
{GITHUB_ENV
}
104 if (isset(APT
[$os_ver][$cc_vnd][$cc_ver])) {
105 $dep = APT
[$os_ver][$cc_vnd][$cc_ver];
107 <?
=PRE?
> echo INSTALL_CC
='<?=$dep["CC"]?>' >> $
{GITHUB_ENV
}
108 <?
=PRE?
> echo INSTALL_CXX
='<?=$dep["CXX"]?>' >> $
{GITHUB_ENV
}
120 function steps_getdeps() {
122 <?
=PRE?
> - name
: Install
dependencies (Linux
)
123 <?
=PRE?
> if: runner
.os
== 'Linux'
125 <?
=PRE?
> sudo apt
-get install \
126 <?
=PRE?
> libevent
-dev \
127 <?
=PRE?
> libsasl2
-dev \
128 <?
=PRE?
> $
{INSTALL_MEMCACHED
} \
129 <?
=PRE?
> $
{INSTALL_CC
} $
{INSTALL_CXX
}
130 <?
=PRE?
> sudo systemctl stop memcached ||
true
131 <?
=PRE?
> - name
: Install
dependencies (Mac
)
132 <?
=PRE?
> if: runner
.os
== 'macOS'
134 <?
=PRE?
> brew install bison flex $
{INSTALL_MEMCACHED
}
135 <?
=PRE?
> brew services stop memcached ||
true
139 function steps_build() {
141 <?
=PRE?
> - name
: Generate build
tree ($
{{ env
.CMAKE_CONFIG_TYPE
}})
142 <?
=PRE?
> run
: cmake
-S
. -B build
143 <?
=PRE?
> - name
: Build all with $
{{ env
.CXX
}} $
{{ env
.CXXFLAGS
}}
144 <?
=PRE?
> run
: make
-C build
-j2 all
145 <?
=PRE?
> - name
: Test
146 <?
=PRE?
> run
: make
-C build
-j2 test
147 <?
=PRE?
> - name
: Install
148 <?
=PRE?
> run
: make
-C build
-j2 install DESTDIR
=.
149 <?
=PRE?
> - name
: Failed tests log
150 <?
=PRE?
> if: $
{{ failure() }}
151 <?
=PRE?
> run
: cat build
/Testing
/Temporary
/LastTest
.log ||
true
155 function steps($splat_map = null) {
156 steps_setenv($splat_map);
161 function defaults() {
162 $os_ver = DEF
[DEF
["os"]];
163 $cc_vnd = DEF
[$os_ver];
164 $cc_ver = DEF
[$cc_vnd]["ver"];
165 return "$os_ver, $cc_vnd, $cc_ver";
182 INSTALL_MEMCACHED
: memcached
183 CMAKE_BUILD_TYPE
: Debug
186 ENABLE_HASH_HSIEH
: "ON"
189 OS_VND
: <?
=DEF
["os"]?
> #
190 OS_VER
: <?
=DEF
[DEF
["os"]]?
> #
191 CC_VND
: <?
=DEF
[DEF
[DEF
["os"]]]?
> #
192 CC_VER
: <?
=DEF
[DEF
[DEF
[DEF
["os"]]]]["ver"]?
> #
198 name
: ci
-dbg (<?
=defaults()?
>, memcached
-1.6)
199 runs
-on
: <?
=DEF
[DEF
["os"]]?
> #
202 MEMCACHED_PREFIX
: /tmp
203 MEMCACHED_BINARY
: /tmp
/bin
/memcached
206 - uses
: actions
/checkout@v2
207 - uses
: actions
/checkout@v2
209 repository
: memcached
/memcached
212 <?php
steps_setenv(); ?
>
213 <?php
steps_getdeps(); ?
>
214 - name
: Build memcached
218 ./configure CFLAGS
="-O2 -pipe" \
219 --prefix
=$
{MEMCACHED_PREFIX
} \
224 --disable
-dependency
-tracking
228 <?php
steps_build(); ?
>
232 name
: ci
-dbg (<?
=defaults()?
>, sanitizers
)
233 runs
-on
: <?
=DEF
[DEF
["os"]]?
> #
235 ENABLE_SANITIZERS
: "address;undefined"
237 - uses
: actions
/checkout@v2
242 name
: ci
-dbg (<?
=defaults()?
>, coverage
)
243 runs
-on
: <?
=DEF
[DEF
["os"]]?
> #
245 CFLAGS
: -O0
--coverage
246 CXXFLAGS
: -O0
--coverage
248 - uses
: actions
/checkout@v2
250 - uses
: codecov
/codecov
-action@v1
.0
.13
254 name
: ci
-dbg (<?
=DEF
["macOS"]?
>, <?
=DEF
[DEF
["macOS"]]?
>, <?
=DEF
[DEF
[DEF
["macOS"]]]["ver"]?
>)
255 runs
-on
: <?
=DEF
["macOS"]?
> #
256 continue-on
-error
: true
258 MEMCACHED_BINARY
: /usr
/local
/bin
/memcached
260 - uses actions
/checkout@v2
261 <?php
steps(false); ?
>
268 os_ver
: [ubuntu
-20.04, ubuntu
-18.04]
270 cc_ver
: [new, cur
, old
]
271 runs
-on
: $
{{ matrix
.os_ver
}}
272 continue-on
-error
: $
{{ matrix
.cc_vnd
== 'clang' }}
274 CMAKE_BUILD_TYPE
: Release
276 OS_VER
: $
{{ matrix
.os_ver
}}
277 CC_VND
: $
{{ matrix
.cc_vnd
}}
278 CC_VER
: $
{{ matrix
.cc_ver
}}
280 - uses
: actions
/checkout@v2
281 <?php
steps(true); ?
>