-<?=PRE?> - name: Install dependencies
-<?=PRE?> if: runner.os == 'Linux'
-<?=PRE?> run: sudo apt-get install libevent-dev libsasl2-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX}
-<?=PRE?> - name: Generate build tree (${CMAKE_CONFIG_TYPE})
-<?=PRE?> run: cmake -S . -B build
-<?=PRE?> - name: Build all with ${CXX} ${CXXFLAGS}
-<?=PRE?> run: make -C build -j2 all
-<?=PRE?> - name: Test
-<?=PRE?> run: make -C build -j2 test
-<?=PRE?> - name: Install
-<?=PRE?> run: make -C build -j2 install DESTDIR=.
-<?=PRE?> - name: Failed tests log
-<?=PRE?> if: ${{ failure() }}
-<?=PRE?> run: cat Testing/Temporary/LastTest.log
+ - name: Generate build tree (${{ env.CMAKE_BUILD_TYPE }})
+ run: cmake --config ${{ env.CMAKE_BUILD_TYPE }} -S . -B build
+ - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
+ run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2
+<?php
+}
+
+function steps_test() {
+?>
+ - name: Test
+ if: env.BUILD_TESTING == 'ON'
+ run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target test
+ - name: Install
+ if: env.BUILD_TESTING == 'ON'
+ run: cmake --install build --config ${{ env.CMAKE_BUILD_TYPE }} --prefix /tmp
+ - name: Failed tests log
+ if: ${{ env.BUILD_TESTING == 'ON' && failure() }}
+ run: cat build/Testing/Temporary/LastTest.log || true
+<?php
+}
+
+function steps_package() {
+?>
+ - name: Package
+ env:
+ PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }}
+ if: env.CC_VER == 'cur' && env.CMAKE_BUILD_TYPE == 'Release'
+ run: |
+ cmake --config ${{ env.CMAKE_BUILD_TYPE }} -S . -B build
+ cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package
+ cmake -DCPACK_COMPONENT_INSTALL=ON build
+ cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package
+ cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target push-artifacts
+<?php
+}
+
+function steps_notify($os_vnd) {
+?>
+ - name: Notify Gitter (success)
+ run: bash .github/notify-gitter.sh ${{ secrets.GITTER }} ${{ success() }}
+<?php
+}
+
+function steps($os_vnd, $splat_map = null) {
+ steps_setenv($os_vnd, $splat_map);
+ steps_getdeps($os_vnd);
+ steps_build();
+ steps_test();
+ steps_package();
+ steps_notify($os_vnd);
+}
+
+function defaults($os_vnd = DEF["os"]) {
+ $os_ver = DEF[$os_vnd];
+ $cc_vnd = DEF[$os_ver];
+ $cc_ver = DEF[$cc_vnd]["ver"];
+ return "$os_ver, $cc_vnd, $cc_ver";
+}
+
+function env_override($os_vnd, $cc_vnd = null) {
+ isset($cc_vnd) or $cc_vnd = DEF[DEF[$os_vnd]];
+?>
+ OS_VND: <?=$os_vnd?> #
+ OS_VER: <?=DEF[$os_vnd]?> #
+ CC_VND: <?=$cc_vnd?> #
+ CC_VER: <?=DEF[$cc_vnd]["ver"]?> #