github: update workflow [ci skip]
[awesomized/libmemcached] / .github / workflows / cmake-build-ci.gen
index bff77cd03da6e49c4067cfa7c90cd7aef101065e..a76ff998ca4591de34496c5aa37903c59ff301ec 100755 (executable)
@@ -165,17 +165,37 @@ function steps_build() {
       - name: Test
         run: make -C build -j2 test
       - name: Install
-        run: make -C build -j2 install DESTDIR=.
+        run: make -C build -j2 install DESTDIR=/tmp
       - name: Failed tests log
         if: ${{ failure() }}
         run: cat build/Testing/Temporary/LastTest.log || true
 <?php
 }
 
+function steps_notify() {
+?>
+      - name: Notify Gitter (success)
+        if: ${{ success() }}
+        run: |
+          REF=$(basename ${GITHUB_REF})
+          curl -sS "${{ secrets.GITTER }}" \
+            --data-urlencode "level=info" \
+            --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}) (${{ job.container.image }}/${CC})"
+      - name: Notify Gitter (failure)
+        if: ${{ failure() }}
+        run: |
+          REF=$(basename ${GITHUB_REF})
+          curl -sS "${{ secrets.GITTER }}" \
+            --data-urlencode "level=error" \
+            --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}) (${{ job.container.image }}/${CC})"
+<?php
+}
+
 function steps($splat_map = null) {
   steps_setenv($splat_map);
   steps_getdeps();
   steps_build();
+  steps_notify();
 }
 
 function defaults() {
@@ -188,11 +208,14 @@ function defaults() {
 name: cmake-build-ci
 on:
   push:
-    paths-ignore:
-      - "docs/**"
+    paths:
+      - "include/**"
+      - "src/**"
+      - "test/**"
+      - "CMake*"
+      - ".github/workflows/cmake-build-ci*"
     branches-ignore:
       - gh-pages
-      - v1.x
   pull_request:
     branches:
       - master
@@ -214,13 +237,15 @@ env:
 jobs:
 
   # new memcached
-  ci-new:
-    name: ci-dbg (<?=defaults()?>, memcached-1.6)
+  dbg-new:
+    name: dbg-new (<?=defaults()?>)
     runs-on: <?=DEF[DEF["os"]]?> #
     env:
       INSTALL_MEMCACHED:
       MEMCACHED_PREFIX: /tmp
       ENABLE_SASL:      "ON"
+      CFLAGS:           "-O0 --coverage"
+      CXXFLAGS:         "-O0 --coverage"
     steps:
       - uses: actions/checkout@v2
       - uses: actions/checkout@v2
@@ -229,10 +254,11 @@ jobs:
           path: memcached
           ref: 1.6.7
 <?php steps(); ?>
+      - uses: codecov/codecov-action@v1.0.13
 
   # sanitizer build
-  ci-san:
-    name: ci-dbg (<?=defaults()?>, sanitizers)
+  dbg-san:
+    name: dbg-san (<?=defaults()?>)
     runs-on: <?=DEF[DEF["os"]]?> #
     env:
       ENABLE_SANITIZERS: "address;undefined"
@@ -240,29 +266,21 @@ jobs:
       - uses: actions/checkout@v2
 <?php steps(); ?>
 
-  # coverage build
-  ci-cov:
-    name: ci-dbg (<?=defaults()?>, coverage)
-    runs-on: <?=DEF[DEF["os"]]?> #
+  # mac build
+  dbg-mac:
+    name: dbg-mac (<?=DEF["macOS"]?>, <?=DEF[DEF["macOS"]]?>, <?=DEF[DEF[DEF["macOS"]]]["ver"]?>)
+    runs-on: <?=DEF["macOS"]?> #
     env:
       CFLAGS: -O0 --coverage
       CXXFLAGS: -O0 --coverage
-    steps:
-      - uses: actions/checkout@v2
-<?php steps(); ?>
-      - uses: codecov/codecov-action@v1.0.13
-
-  # mac build
-  ci-mac:
-    name: ci-dbg (<?=DEF["macOS"]?>, <?=DEF[DEF["macOS"]]?>, <?=DEF[DEF[DEF["macOS"]]]["ver"]?>)
-    runs-on: <?=DEF["macOS"]?> #
     continue-on-error: true
     steps:
       - uses: actions/checkout@v2
 <?php steps(false); ?>
+      - uses: codecov/codecov-action@v1.0.13
 
   # release builds
-  ci-rel:
+  release:
     strategy:
       fail-fast: false
       matrix: