mac build
authorMichael Wallner <mike@php.net>
Fri, 2 Oct 2020 21:31:46 +0000 (23:31 +0200)
committerMichael Wallner <mike@php.net>
Fri, 2 Oct 2020 21:31:46 +0000 (23:31 +0200)
.github/workflows/cmake-build-ci.gen
.github/workflows/cmake-build-ci.yml
CMake/CheckDependency.cmake

index b9ce97fe218ecb548acfe773af154082bd84cf34..3aa1e0376b54c288b6b18eb11fbefe2576c3d5fa 100755 (executable)
@@ -16,7 +16,7 @@ const DEF = [
     "CXX"  => "g++",
   ],
   "clang" => [
-    "ver" => "",
+    "ver" => "apple",
     "CC"  => "clang",
     "CXX"  => "clang++",
   ],
@@ -119,9 +119,20 @@ function steps_setenv($splat_map = null) {
 
 function steps_getdeps() {
 ?>
-<?=PRE?> - name: Install dependencies
+<?=PRE?> - name: Install dependencies (Linux)
 <?=PRE?>   if: runner.os == 'Linux'
-<?=PRE?>   run: sudo apt-get install libevent-dev libsasl2-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX}
+<?=PRE?>   run: |
+<?=PRE?>     sudo apt-get install \
+<?=PRE?>       libevent-dev \
+<?=PRE?>       libsasl2-dev \
+<?=PRE?>       ${INSTALL_MEMCACHED} \
+<?=PRE?>       ${INSTALL_CC} ${INSTALL_CXX}
+<?=PRE?>     sudo systemctl stop memcached || true
+<?=PRE?> - name: Install dependencies (Mac)
+<?=PRE?>   if: runner.os == 'macOS'
+<?=PRE?>   run: |
+<?=PRE?>     brew install bison flex ${INSTALL_MEMCACHED}
+<?=PRE?>     brew services stop memcached || true
 <?php
 }
 
@@ -238,6 +249,17 @@ jobs:
 <?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
+    env:
+      MEMCACHED_BINARY: /usr/local/bin/memcached
+    steps:
+      - uses actions/checkout@v2
+<?php steps(false); ?>
+
   # release builds
   ci-rel:
     strategy:
index 67d1022a29c857f3f3ba52a9466605deb70240ce..fcb5a5010219349842c6988e46517adcc9a3e2fe 100644 (file)
@@ -48,9 +48,20 @@ jobs:
         run: |
           echo CC=gcc-9 >> ${GITHUB_ENV}
           echo CXX=g++-9 >> ${GITHUB_ENV}
-      - name: Install dependencies
+      - name: Install dependencies (Linux)
         if: runner.os == 'Linux'
-        run: sudo apt-get install libevent-dev libsasl2-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX}
+        run: |
+          sudo apt-get install \
+            libevent-dev \
+            libsasl2-dev \
+            ${INSTALL_MEMCACHED} \
+            ${INSTALL_CC} ${INSTALL_CXX}
+          sudo systemctl stop memcached || true
+      - name: Install dependencies (Mac)
+        if: runner.os == 'macOS'
+        run: |
+          brew install bison flex ${INSTALL_MEMCACHED}
+          brew services stop memcached || true
       - name: Build memcached
         run: |
           cd memcached
@@ -90,9 +101,20 @@ jobs:
         run: |
           echo CC=gcc-9 >> ${GITHUB_ENV}
           echo CXX=g++-9 >> ${GITHUB_ENV}
-      - name: Install dependencies
+      - name: Install dependencies (Linux)
         if: runner.os == 'Linux'
-        run: sudo apt-get install libevent-dev libsasl2-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX}
+        run: |
+          sudo apt-get install \
+            libevent-dev \
+            libsasl2-dev \
+            ${INSTALL_MEMCACHED} \
+            ${INSTALL_CC} ${INSTALL_CXX}
+          sudo systemctl stop memcached || true
+      - name: Install dependencies (Mac)
+        if: runner.os == 'macOS'
+        run: |
+          brew install bison flex ${INSTALL_MEMCACHED}
+          brew services stop memcached || true
       - name: Generate build tree (${{ env.CMAKE_CONFIG_TYPE }})
         run: cmake -S . -B build
       - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
@@ -119,9 +141,20 @@ jobs:
         run: |
           echo CC=gcc-9 >> ${GITHUB_ENV}
           echo CXX=g++-9 >> ${GITHUB_ENV}
-      - name: Install dependencies
+      - name: Install dependencies (Linux)
         if: runner.os == 'Linux'
-        run: sudo apt-get install libevent-dev libsasl2-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX}
+        run: |
+          sudo apt-get install \
+            libevent-dev \
+            libsasl2-dev \
+            ${INSTALL_MEMCACHED} \
+            ${INSTALL_CC} ${INSTALL_CXX}
+          sudo systemctl stop memcached || true
+      - name: Install dependencies (Mac)
+        if: runner.os == 'macOS'
+        run: |
+          brew install bison flex ${INSTALL_MEMCACHED}
+          brew services stop memcached || true
       - name: Generate build tree (${{ env.CMAKE_CONFIG_TYPE }})
         run: cmake -S . -B build
       - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
@@ -135,6 +168,41 @@ jobs:
         run: cat build/Testing/Temporary/LastTest.log || true
       - uses: codecov/codecov-action@v1.0.13
 
+  # mac build
+  ci-mac:
+    name: ci-dbg (macos-10.15, clang, apple)
+    runs-on: macos-10.15 #
+    continue-on-error: true
+    env:
+      MEMCACHED_BINARY: /usr/local/bin/memcached
+    steps:
+      - uses actions/checkout@v2
+      - name: Install dependencies (Linux)
+        if: runner.os == 'Linux'
+        run: |
+          sudo apt-get install \
+            libevent-dev \
+            libsasl2-dev \
+            ${INSTALL_MEMCACHED} \
+            ${INSTALL_CC} ${INSTALL_CXX}
+          sudo systemctl stop memcached || true
+      - name: Install dependencies (Mac)
+        if: runner.os == 'macOS'
+        run: |
+          brew install bison flex ${INSTALL_MEMCACHED}
+          brew services stop memcached || true
+      - name: Generate build tree (${{ env.CMAKE_CONFIG_TYPE }})
+        run: cmake -S . -B build
+      - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
+        run: make -C build -j2 all
+      - name: Test
+        run: make -C build -j2 test
+      - name: Install
+        run: make -C build -j2 install DESTDIR=.
+      - name: Failed tests log
+        if: ${{ failure() }}
+        run: cat build/Testing/Temporary/LastTest.log || true
+
   # release builds
   ci-rel:
     strategy:
@@ -217,9 +285,20 @@ jobs:
           echo CXX=clang++-7 >> ${GITHUB_ENV}
           echo INSTALL_CC='clang-7' >> ${GITHUB_ENV}
           echo INSTALL_CXX='clang-7' >> ${GITHUB_ENV}
-      - name: Install dependencies
+      - name: Install dependencies (Linux)
         if: runner.os == 'Linux'
-        run: sudo apt-get install libevent-dev libsasl2-dev ${INSTALL_MEMCACHED} ${INSTALL_CC} ${INSTALL_CXX}
+        run: |
+          sudo apt-get install \
+            libevent-dev \
+            libsasl2-dev \
+            ${INSTALL_MEMCACHED} \
+            ${INSTALL_CC} ${INSTALL_CXX}
+          sudo systemctl stop memcached || true
+      - name: Install dependencies (Mac)
+        if: runner.os == 'macOS'
+        run: |
+          brew install bison flex ${INSTALL_MEMCACHED}
+          brew services stop memcached || true
       - name: Generate build tree (${{ env.CMAKE_CONFIG_TYPE }})
         run: cmake -S . -B build
       - name: Build all with ${{ env.CXX }} ${{ env.CXXFLAGS }}
index 3cb575354562ac81a36956531a1201a396a47786..edcaea4d4f0f62403b9b9c1e5450fce268cb578d 100644 (file)
@@ -3,6 +3,7 @@ find_package(PkgConfig)
 include(SafeString)
 include(CheckHeader)
 
+
 function(check_dependency NAME LIB HEADER)
     if(PKG_CONFIG_FOUND)
         pkg_check_modules(${NAME} lib${LIB}${ARGN})