summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Borzì <borzifrancesco@gmail.com>2020-08-21 12:19:02 +0200
committerGitHub <noreply@github.com>2020-08-21 12:19:02 +0200
commit2ad98c573a2b75991269030327e8d26bf3eb7bd3 (patch)
treef1446bbc1a46b95f4da27461353bce21628942c5
parented8ed175b7285089bc9c503bd515a4609af5c388 (diff)
feat(CI): add macOS to our CI (#3321)
Co-Authored-By: Meerd <meerd@users.noreply.github.com>
-rw-r--r--.github/workflows/core_build.yml22
-rw-r--r--CMakeLists.txt3
-rwxr-xr-xapps/ci/mac/ci-compile.sh29
-rwxr-xr-xapps/ci/mac/ci-install.sh4
4 files changed, 58 insertions, 0 deletions
diff --git a/.github/workflows/core_build.yml b/.github/workflows/core_build.yml
index 43110a1d77..65fae08ec7 100644
--- a/.github/workflows/core_build.yml
+++ b/.github/workflows/core_build.yml
@@ -52,6 +52,28 @@ jobs:
- name: Run unit tests
run: source ./apps/ci/ci-run-unit-tests.sh
+ mac-build:
+ strategy:
+ fail-fast: false
+ runs-on: macos-10.15
+ name: macos-10.15
+ steps:
+ - uses: actions/checkout@v2
+ - name: Cache
+ uses: actions/cache@v1.1.2
+ with:
+ path: /Users/runner/.ccache
+ key: ccache:macos-10.15:${{ github.ref }}:${{ github.sha }}
+ restore-keys: |
+ ccache:macos-10.15:${{ github.ref }}
+ ccache:macos-10.15
+ - name: Configure OS
+ run: source ./apps/ci/mac/ci-install.sh
+ - name: Build
+ run: source ./apps/ci/mac/ci-compile.sh
+ - name: Run unit tests
+ run: source ./apps/ci/ci-run-unit-tests.sh
+
docker-build:
strategy:
fail-fast: true
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9c5696ff81..7473c64661 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,6 +98,9 @@ set(ACE_EXPECTED_VERSION 6.0.3)
find_package(PCHSupport)
find_package(ACE REQUIRED)
+if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ add_definitions(-DACE_LACKS_AUTO_PTR=1)
+endif()
find_package(MySQL REQUIRED)
if(UNIX AND WITH_PERFTOOLS)
diff --git a/apps/ci/mac/ci-compile.sh b/apps/ci/mac/ci-compile.sh
new file mode 100755
index 0000000000..fc0a008b5a
--- /dev/null
+++ b/apps/ci/mac/ci-compile.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+export CCACHE_CPP2=true
+export CCACHE_MAXSIZE='500MB'
+ccache -s
+
+mkdir var/build/obj && cd var/build/obj;
+
+time cmake ../../../ \
+-DTOOLS=1 \
+-DUNIT_TESTS=1 \
+-DSCRIPTS=1 \
+-DCMAKE_BUILD_TYPE=Debug \
+-DMYSQL_ADD_INCLUDE_PATH=/usr/local/include \
+-DMYSQL_LIBRARY=/usr/local/lib/libmysqlclient.dylib \
+-DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include \
+-DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib \
+-DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include \
+-DOPENSSL_SSL_LIBRARIES=/usr/local/opt/openssl/lib/libssl.dylib \
+-DOPENSSL_CRYPTO_LIBRARIES=/usr/local/opt/openssl/lib/libcrypto.dylib \
+-DCMAKE_C_FLAGS="-Werror" \
+-DCMAKE_CXX_FLAGS="-Werror" \
+-DCMAKE_C_COMPILER_LAUNCHER=ccache \
+-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
+;
+
+time make -j $(($(sysctl -n hw.ncpu ) + 2))
+
+ccache -s
diff --git a/apps/ci/mac/ci-install.sh b/apps/ci/mac/ci-install.sh
new file mode 100755
index 0000000000..8b1d20aa87
--- /dev/null
+++ b/apps/ci/mac/ci-install.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+
+time brew update
+time brew install openssl readline ace coreutils bash bash-completion mysql ccache