ci: gh-action fetch tags
[m6w6/libmemcached] / .github / workflows / cmake-build-ci.yml
index 09cfb6706f0ffe47edbc9a85b8394af21ea6acc9..028d6cf9251f77ca84c70837b35e1f8f0c57269f 100644 (file)
@@ -3,10 +3,12 @@ name: cmake-build-ci
 on:
   push:
     paths:
+      - "contrib/**"
       - "include/**"
       - "src/**"
       - "test/**"
       - "CMake*"
+      - "CPack*"
       - ".github/workflows/cmake-build-ci*"
     branches-ignore:
       - gh-pages
@@ -17,7 +19,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 +41,7 @@ jobs:
       CXXFLAGS:           "-O0 --coverage"
       INSTALL_MEMCACHED:  ""
       MEMCACHED_PREFIX:   "/tmp"
+      ENABLE_SASL:        "ON"
     steps:
       - uses: actions/checkout@v2
       - uses: actions/checkout@v2
@@ -54,11 +57,10 @@ jobs:
       - name: Install dependencies (Linux)
         if: runner.os == 'Linux'
         run: |
-          sudo apt-get install \
+          sudo apt-get install -my \
             libevent-dev \
             libsasl2-dev \
             libtbb-dev \
-            python3-m2r \
             python3-sphinx \
             ${INSTALL_MEMCACHED} \
             ${INSTALL_CC} ${INSTALL_CXX}
@@ -95,9 +97,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
@@ -146,11 +149,10 @@ jobs:
       - name: Install dependencies (Linux)
         if: runner.os == 'Linux'
         run: |
-          sudo apt-get install \
+          sudo apt-get install -my \
             libevent-dev \
             libsasl2-dev \
             libtbb-dev \
-            python3-m2r \
             python3-sphinx \
             ${INSTALL_MEMCACHED} \
             ${INSTALL_CC} ${INSTALL_CXX}
@@ -187,9 +189,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
@@ -237,11 +240,10 @@ jobs:
       - name: Install dependencies (Linux)
         if: runner.os == 'Linux'
         run: |
-          sudo apt-get install \
+          sudo apt-get install -my \
             libevent-dev \
             libsasl2-dev \
             libtbb-dev \
-            python3-m2r \
             python3-sphinx \
             ${INSTALL_MEMCACHED} \
             ${INSTALL_CC} ${INSTALL_CXX}
@@ -278,9 +280,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 +318,6 @@ jobs:
     runs-on: macos-10.15 #
     env:
       CMAKE_BUILD_TYPE:   "Debug"
-      ENABLE_SASL:        "OFF"
       BUILD_TESTING:      "ON"
       VERBOSE:            "ON"
       CFLAGS:             "-O0 --coverage"
@@ -331,11 +333,10 @@ jobs:
       - name: Install dependencies (Linux)
         if: runner.os == 'Linux'
         run: |
-          sudo apt-get install \
+          sudo apt-get install -my \
             libevent-dev \
             libsasl2-dev \
             libtbb-dev \
-            python3-m2r \
             python3-sphinx \
             ${INSTALL_MEMCACHED} \
             ${INSTALL_CC} ${INSTALL_CXX}
@@ -372,9 +373,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
@@ -409,7 +411,7 @@ jobs:
     name: rel-mac (macos-10.15, clang, cur)
     runs-on: macos-10.15 #
     env:
-      ENABLE_SASL:        "OFF"
+      CMAKE_BUILD_TYPE:   "Release"
       BUILD_DOCS_MANGZ:   "ON"
       OS_VND:   macOS #
       OS_VER:   macos-10.15 #
@@ -418,14 +420,15 @@ jobs:
     continue-on-error: true
     steps:
       - uses: actions/checkout@v2
+      - name: Fetch tags
+        run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
       - name: Install dependencies (Linux)
         if: runner.os == 'Linux'
         run: |
-          sudo apt-get install \
+          sudo apt-get install -my \
             libevent-dev \
             libsasl2-dev \
             libtbb-dev \
-            python3-m2r \
             python3-sphinx \
             ${INSTALL_MEMCACHED} \
             ${INSTALL_CC} ${INSTALL_CXX}
@@ -462,9 +465,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
@@ -498,7 +502,7 @@ jobs:
     name: win-msvc (windows-2019, msvc, cur)
     runs-on: windows-2019 #
     env:
-      ENABLE_SASL:      "OFF"
+      CMAKE_BUILD_TYPE: "Release"
       BISON_ROOT:       "C:/msys64/usr"
       FLEX_ROOT:        "C:/msys64/usr"
       OS_VND:   Windows #
@@ -506,11 +510,10 @@ jobs:
       CC_VND:   msvc #
       CC_VER:   cur #
     continue-on-error: true
-    defaults:
-      run:
-        shell: msys2 {0}
     steps:
       - uses: actions/checkout@v2
+      - name: Fetch tags
+        run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
       - uses: msys2/setup-msys2@v2
         with:
           release: false
@@ -542,6 +545,7 @@ jobs:
     runs-on: ${{ matrix.os_ver }}
     continue-on-error: ${{ matrix.cc_vnd == 'clang' }}
     env:
+      CMAKE_BUILD_TYPE: "Release"
       BUILD_DOCS_MANGZ: "ON"
       OS_VND: Linux
       OS_VER: ${{ matrix.os_ver }}
@@ -549,6 +553,8 @@ jobs:
       CC_VER: ${{ matrix.cc_ver }}
     steps:
       - uses: actions/checkout@v2
+      - name: Fetch tags
+        run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
       - name: Prepare environment (for new gnu on ubuntu-20.04)
         if: (env.OS_VER=='ubuntu-20.04') && (env.CC_VND=='gnu') && (env.CC_VER=='new')
         run: |
@@ -620,11 +626,10 @@ jobs:
       - name: Install dependencies (Linux)
         if: runner.os == 'Linux'
         run: |
-          sudo apt-get install \
+          sudo apt-get install -my \
             libevent-dev \
             libsasl2-dev \
             libtbb-dev \
-            python3-m2r \
             python3-sphinx \
             ${INSTALL_MEMCACHED} \
             ${INSTALL_CC} ${INSTALL_CXX}
@@ -661,9 +666,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