cmake: CI fixes
authorMichael Wallner <mike@php.net>
Thu, 17 Dec 2020 07:24:55 +0000 (08:24 +0100)
committerMichael Wallner <mike@php.net>
Thu, 17 Dec 2020 07:43:38 +0000 (08:43 +0100)
.github/workflows/cmake-build-ci.gen
.github/workflows/cmake-build-ci.yml
docs/CMakeLists.txt
scripts/push-artifacts.sh

index 2d07e8dc2b546d65a3db20bf21c8ba6285be8862..dd5f8c85e4a33ed995e1f2d747e35f66e2642cbc 100755 (executable)
@@ -140,7 +140,6 @@ function steps_getdeps() {
             libevent-dev \
             libsasl2-dev \
             libtbb-dev \
-            m2r \
             python3-sphinx \
             ${INSTALL_MEMCACHED} \
             ${INSTALL_CC} ${INSTALL_CXX}
@@ -181,10 +180,16 @@ function steps_build() {
         run: cmake -S . -B build
       - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
         run: cmake --build build -j2
+<?php
+}
+
+function steps_test() {
+?>
       - name: Test
-        run: cmake --build build -j2 --target test
-      - name: Install
-        run: cmake --build build -j2 --target install -- DESTDIR=/tmp
+        if: env.BUILD_TESTING == 'ON'
+        run: |
+          cmake --build build -j2 --target test
+          cmake --build build -j2 --target install -- DESTDIR=/tmp
       - name: Failed tests log
         if: ${{ failure() }}
         run: cat build/Testing/Temporary/LastTest.log || true
@@ -229,6 +234,7 @@ function steps($splat_map = null) {
   steps_setenv($splat_map);
   steps_getdeps();
   steps_build();
+  steps_test();
   steps_package();
   steps_notify();
 }
@@ -268,7 +274,7 @@ on:
 env:
   # defaults
   INSTALL_MEMCACHED:  memcached
-  ENABLE_SASL:        "ON"
+  ENABLE_SASL:        "OFF" # ^ almost no memcached distribution package has built in sasl support
   ENABLE_HASH_HSIEH:  "ON"
   ENABLE_DTRACE:      "OFF"
   OS_VND:   <?=DEF["os"]?> #
@@ -290,6 +296,7 @@ jobs:
       CXXFLAGS:           "-O0 --coverage"
       INSTALL_MEMCACHED:  ""
       MEMCACHED_PREFIX:   "/tmp"
+      ENABLE_SASL:        "ON"
     steps:
       - uses: actions/checkout@v2
       - uses: actions/checkout@v2
@@ -332,7 +339,6 @@ jobs:
     runs-on: <?=DEF["macOS"]?> #
     env:
       CMAKE_BUILD_TYPE:   "Debug"
-      ENABLE_SASL:        "OFF"
       BUILD_TESTING:      "ON"
       VERBOSE:            "ON"
       CFLAGS:             "-O0 --coverage"
@@ -350,7 +356,6 @@ jobs:
     runs-on: <?=DEF["macOS"]?> #
     env:
       CMAKE_BUILD_TYPE:   "Release"
-      ENABLE_SASL:        "OFF"
       BUILD_DOCS_MANGZ:   "ON"
 <?php env_override("macOS")?>
     continue-on-error: true
@@ -364,14 +369,10 @@ jobs:
     runs-on: <?=DEF["Windows"]?> #
     env:
       CMAKE_BUILD_TYPE: "Release"
-      ENABLE_SASL:      "OFF"
       BISON_ROOT:       "C:/msys64/usr"
       FLEX_ROOT:        "C:/msys64/usr"
 <?php env_override("Windows")?>
     continue-on-error: true
-    defaults:
-      run:
-        shell: msys2 {0}
     steps:
       - uses: actions/checkout@v2
       - uses: msys2/setup-msys2@v2
index cf86dbbf400cd19ca2bd06f8d0decedd8cfa2628..e51e972078145882efeabad44432dc0f4629431c 100644 (file)
@@ -17,7 +17,7 @@ on:
 env:
   # defaults
   INSTALL_MEMCACHED:  memcached
-  ENABLE_SASL:        "ON"
+  ENABLE_SASL:        "OFF" # ^ almost no memcached distribution package has built in sasl support
   ENABLE_HASH_HSIEH:  "ON"
   ENABLE_DTRACE:      "OFF"
   OS_VND:   Linux #
@@ -39,6 +39,7 @@ jobs:
       CXXFLAGS:           "-O0 --coverage"
       INSTALL_MEMCACHED:  ""
       MEMCACHED_PREFIX:   "/tmp"
+      ENABLE_SASL:        "ON"
     steps:
       - uses: actions/checkout@v2
       - uses: actions/checkout@v2
@@ -58,7 +59,6 @@ jobs:
             libevent-dev \
             libsasl2-dev \
             libtbb-dev \
-            m2r \
             python3-sphinx \
             ${INSTALL_MEMCACHED} \
             ${INSTALL_CC} ${INSTALL_CXX}
@@ -95,9 +95,10 @@ jobs:
       - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
         run: cmake --build build -j2
       - name: Test
-        run: cmake --build build -j2 --target test
-      - name: Install
-        run: cmake --build build -j2 --target install -- DESTDIR=/tmp
+        if: env.BUILD_TESTING == 'ON'
+        run: |
+          cmake --build build -j2 --target test
+          cmake --build build -j2 --target install -- DESTDIR=/tmp
       - name: Failed tests log
         if: ${{ failure() }}
         run: cat build/Testing/Temporary/LastTest.log || true
@@ -150,7 +151,6 @@ jobs:
             libevent-dev \
             libsasl2-dev \
             libtbb-dev \
-            m2r \
             python3-sphinx \
             ${INSTALL_MEMCACHED} \
             ${INSTALL_CC} ${INSTALL_CXX}
@@ -187,9 +187,10 @@ jobs:
       - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
         run: cmake --build build -j2
       - name: Test
-        run: cmake --build build -j2 --target test
-      - name: Install
-        run: cmake --build build -j2 --target install -- DESTDIR=/tmp
+        if: env.BUILD_TESTING == 'ON'
+        run: |
+          cmake --build build -j2 --target test
+          cmake --build build -j2 --target install -- DESTDIR=/tmp
       - name: Failed tests log
         if: ${{ failure() }}
         run: cat build/Testing/Temporary/LastTest.log || true
@@ -241,7 +242,6 @@ jobs:
             libevent-dev \
             libsasl2-dev \
             libtbb-dev \
-            m2r \
             python3-sphinx \
             ${INSTALL_MEMCACHED} \
             ${INSTALL_CC} ${INSTALL_CXX}
@@ -278,9 +278,10 @@ jobs:
       - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
         run: cmake --build build -j2
       - name: Test
-        run: cmake --build build -j2 --target test
-      - name: Install
-        run: cmake --build build -j2 --target install -- DESTDIR=/tmp
+        if: env.BUILD_TESTING == 'ON'
+        run: |
+          cmake --build build -j2 --target test
+          cmake --build build -j2 --target install -- DESTDIR=/tmp
       - name: Failed tests log
         if: ${{ failure() }}
         run: cat build/Testing/Temporary/LastTest.log || true
@@ -315,7 +316,6 @@ jobs:
     runs-on: macos-10.15 #
     env:
       CMAKE_BUILD_TYPE:   "Debug"
-      ENABLE_SASL:        "OFF"
       BUILD_TESTING:      "ON"
       VERBOSE:            "ON"
       CFLAGS:             "-O0 --coverage"
@@ -335,7 +335,6 @@ jobs:
             libevent-dev \
             libsasl2-dev \
             libtbb-dev \
-            m2r \
             python3-sphinx \
             ${INSTALL_MEMCACHED} \
             ${INSTALL_CC} ${INSTALL_CXX}
@@ -372,9 +371,10 @@ jobs:
       - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
         run: cmake --build build -j2
       - name: Test
-        run: cmake --build build -j2 --target test
-      - name: Install
-        run: cmake --build build -j2 --target install -- DESTDIR=/tmp
+        if: env.BUILD_TESTING == 'ON'
+        run: |
+          cmake --build build -j2 --target test
+          cmake --build build -j2 --target install -- DESTDIR=/tmp
       - name: Failed tests log
         if: ${{ failure() }}
         run: cat build/Testing/Temporary/LastTest.log || true
@@ -410,7 +410,6 @@ jobs:
     runs-on: macos-10.15 #
     env:
       CMAKE_BUILD_TYPE:   "Release"
-      ENABLE_SASL:        "OFF"
       BUILD_DOCS_MANGZ:   "ON"
       OS_VND:   macOS #
       OS_VER:   macos-10.15 #
@@ -426,7 +425,6 @@ jobs:
             libevent-dev \
             libsasl2-dev \
             libtbb-dev \
-            m2r \
             python3-sphinx \
             ${INSTALL_MEMCACHED} \
             ${INSTALL_CC} ${INSTALL_CXX}
@@ -463,9 +461,10 @@ jobs:
       - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
         run: cmake --build build -j2
       - name: Test
-        run: cmake --build build -j2 --target test
-      - name: Install
-        run: cmake --build build -j2 --target install -- DESTDIR=/tmp
+        if: env.BUILD_TESTING == 'ON'
+        run: |
+          cmake --build build -j2 --target test
+          cmake --build build -j2 --target install -- DESTDIR=/tmp
       - name: Failed tests log
         if: ${{ failure() }}
         run: cat build/Testing/Temporary/LastTest.log || true
@@ -500,7 +499,6 @@ jobs:
     runs-on: windows-2019 #
     env:
       CMAKE_BUILD_TYPE: "Release"
-      ENABLE_SASL:      "OFF"
       BISON_ROOT:       "C:/msys64/usr"
       FLEX_ROOT:        "C:/msys64/usr"
       OS_VND:   Windows #
@@ -508,9 +506,6 @@ jobs:
       CC_VND:   msvc #
       CC_VER:   cur #
     continue-on-error: true
-    defaults:
-      run:
-        shell: msys2 {0}
     steps:
       - uses: actions/checkout@v2
       - uses: msys2/setup-msys2@v2
@@ -627,7 +622,6 @@ jobs:
             libevent-dev \
             libsasl2-dev \
             libtbb-dev \
-            m2r \
             python3-sphinx \
             ${INSTALL_MEMCACHED} \
             ${INSTALL_CC} ${INSTALL_CXX}
@@ -664,9 +658,10 @@ jobs:
       - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
         run: cmake --build build -j2
       - name: Test
-        run: cmake --build build -j2 --target test
-      - name: Install
-        run: cmake --build build -j2 --target install -- DESTDIR=/tmp
+        if: env.BUILD_TESTING == 'ON'
+        run: |
+          cmake --build build -j2 --target test
+          cmake --build build -j2 --target install -- DESTDIR=/tmp
       - name: Failed tests log
         if: ${{ failure() }}
         run: cat build/Testing/Temporary/LastTest.log || true
index 303ceada3fa46eeecf4092308b70b9ab0a946524..c2d6325ab75a0e7a57460de651184058be6c99aa 100644 (file)
@@ -40,14 +40,15 @@ else()
         add_custom_command(
                 OUTPUT "${SPHINX_HTML_DIR}"
                 COMMAND
-                ${SPHINX_EXECUTABLE}
-                -q -b html
-                -c "${SPHINX_BUILD_DIR}"
-                -d "${SPHINX_CACHE_DIR}"
-                ${SPHINX_OPTIONS}
-                "${SPHINX_SOURCE_DIR}"
-                "${SPHINX_HTML_DIR}"
-                COMMAND ${CMAKE_COMMAND} -E touch html
+                    ${SPHINX_EXECUTABLE}
+                    -q -b html
+                    -c "${SPHINX_BUILD_DIR}"
+                    -d "${SPHINX_CACHE_DIR}"
+                    ${SPHINX_OPTIONS}
+                    "${SPHINX_SOURCE_DIR}"
+                    "${SPHINX_HTML_DIR}"
+                COMMAND
+                    ${CMAKE_COMMAND} -E touch "${SPHINX_HTML_DIR}"
                 BYPRODUCTS ${SPHINX_HTML_DIR}
                 DEPENDS "${DOCS_SOURCE}"
                 )
@@ -62,14 +63,15 @@ else()
         add_custom_command(
                 OUTPUT ${SPHINX_MAN_DIR}
                 COMMAND
-                ${SPHINX_EXECUTABLE}
-                -q -b man
-                -c "${SPHINX_BUILD_DIR}"
-                -d "${SPHINX_CACHE_DIR}"
-                ${SPHINX_OPTIONS}
-                "${SPHINX_SOURCE_DIR}"
-                "${SPHINX_MAN_DIR}"
-                COMMAND ${CMAKE_COMMAND} -E touch man
+                    ${SPHINX_EXECUTABLE}
+                    -q -b man
+                    -c "${SPHINX_BUILD_DIR}"
+                    -d "${SPHINX_CACHE_DIR}"
+                    ${SPHINX_OPTIONS}
+                    "${SPHINX_SOURCE_DIR}"
+                    "${SPHINX_MAN_DIR}"
+                COMMAND
+                    ${CMAKE_COMMAND} -E touch "${SPHINX_MAN_DIR}"
                 BYPRODUCTS ${SPHINX_MAN_DIR}
                 DEPENDS "${DOCS_SOURCE}"
                 )
@@ -86,9 +88,11 @@ else()
             if(GZIP)
                 set(MAN_EXT ".gz")
                 add_custom_target(man_gz ALL
-                        ${GZIP} -kf ${SPHINX_MAN_DIR}/*.{1,3}
+                        COMMAND ${GZIP} -kf
+                            ${SPHINX_MAN_DIR}/*.1
+                            ${SPHINX_MAN_DIR}/*.3
                         DEPENDS ${SPHINX_MAN_DIR}
-                        )
+                        ) # some shells do not support braced glob patterns
             endif()
         endif()
 
index 45280ee3b0985e5598f9336ce6e9efe770449f1f..6ed63d27ea800298c6e9f9b7ae50c1865a1a0c13 100755 (executable)
@@ -4,6 +4,7 @@
 if test -n "$PUSH_ARTIFACTS_ID"
 then
   echo "$PUSH_ARTIFACTS_ID" > push-artifacts.id
+  chmod 0600 push-artifacts.id
 fi
 
 RSYNC_CONF=$(dirname $0)/push-artifacts.conf