github: workflow notofies gitter [ci skip]
authorMichael Wallner <mike@php.net>
Fri, 23 Oct 2020 17:58:34 +0000 (19:58 +0200)
committerMichael Wallner <mike@php.net>
Fri, 23 Oct 2020 17:58:34 +0000 (19:58 +0200)
.github/workflows/cmake-build-ci.gen
.github/workflows/cmake-build-ci.yml

index bee2d0572ade554ed7f8e7a5efd2a00428b9b72a..e07451627b6b2a69ec00b481f980c8b8b1b1e4e1 100755 (executable)
@@ -172,10 +172,30 @@ function steps_build() {
 <?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/runs/${GITHUB_RUN_ID}) (${{ job.container }}/${CXX})"
+      - 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/runs/${GITHUB_RUN_ID}) (${{ job.container }}/${CXX})"
+<?php
+}
+
 function steps($splat_map = null) {
   steps_setenv($splat_map);
   steps_getdeps();
   steps_build();
+  steps_notify();
 }
 
 function defaults() {
index 7bb25a7ad4c7553740bcf74fa801d9164546a017..594d8ffa1b1728417ae8a5ce91fafe5521294f5a 100644 (file)
@@ -99,6 +99,20 @@ jobs:
       - name: Failed tests log
         if: ${{ failure() }}
         run: cat build/Testing/Temporary/LastTest.log || true
+      - 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/runs/${GITHUB_RUN_ID}) (${{ job.container }}/${CXX})"
+      - 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/runs/${GITHUB_RUN_ID}) (${{ job.container }}/${CXX})"
       - uses: codecov/codecov-action@v1.0.13
 
   # sanitizer build
@@ -161,6 +175,20 @@ jobs:
       - name: Failed tests log
         if: ${{ failure() }}
         run: cat build/Testing/Temporary/LastTest.log || true
+      - 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/runs/${GITHUB_RUN_ID}) (${{ job.container }}/${CXX})"
+      - 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/runs/${GITHUB_RUN_ID}) (${{ job.container }}/${CXX})"
 
   # mac build
   dbg-mac:
@@ -219,6 +247,20 @@ jobs:
       - name: Failed tests log
         if: ${{ failure() }}
         run: cat build/Testing/Temporary/LastTest.log || true
+      - 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/runs/${GITHUB_RUN_ID}) (${{ job.container }}/${CXX})"
+      - 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/runs/${GITHUB_RUN_ID}) (${{ job.container }}/${CXX})"
       - uses: codecov/codecov-action@v1.0.13
 
   # release builds
@@ -349,3 +391,17 @@ jobs:
       - name: Failed tests log
         if: ${{ failure() }}
         run: cat build/Testing/Temporary/LastTest.log || true
+      - 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/runs/${GITHUB_RUN_ID}) (${{ job.container }}/${CXX})"
+      - 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/runs/${GITHUB_RUN_ID}) (${{ job.container }}/${CXX})"