From 0067d45ba45f7697df6b43acdb00b69600dd7925 Mon Sep 17 00:00:00 2001 From: Patrick Lewis Date: Tue, 22 Dec 2020 09:55:58 -0800 Subject: [PATCH] feat(CI/MacOS): use acore.sh to install deps (#4003) --- .github/workflows/core_build.yml | 4 +++- apps/bash_shared/defines.sh | 10 +++++++++- apps/ci/mac/ci-compile.sh | 2 +- apps/ci/mac/ci-install.sh | 10 ---------- apps/installer/includes/os_configs/osx.sh | 13 +++++++++++-- 5 files changed, 24 insertions(+), 15 deletions(-) delete mode 100755 apps/ci/mac/ci-install.sh diff --git a/.github/workflows/core_build.yml b/.github/workflows/core_build.yml index 983069a89..6f4376330 100644 --- a/.github/workflows/core_build.yml +++ b/.github/workflows/core_build.yml @@ -85,8 +85,10 @@ jobs: restore-keys: | ccache:${{ matrix.os }}:${{ github.ref }} ccache:${{ matrix.os }} + - name: Install latest bash + run: brew install bash - name: Configure OS - run: source ./apps/ci/mac/ci-install.sh + run: source ./acore.sh install-deps - name: Build run: source ./apps/ci/mac/ci-compile.sh - name: Run unit tests diff --git a/apps/bash_shared/defines.sh b/apps/bash_shared/defines.sh index 605d3c30f..ed70cac1d 100644 --- a/apps/bash_shared/defines.sh +++ b/apps/bash_shared/defines.sh @@ -1,5 +1,14 @@ unamestr=$(uname) if [[ "$unamestr" == 'Darwin' ]]; then + if ! command -v brew &>/dev/null ; then + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + fi + if ! [ "${BASH_VERSINFO}" -ge 4 ]; then + brew install bash + fi + if ! command -v greadlink &>/dev/null ; then + brew install coreutils + fi AC_PATH_ROOT=$(greadlink -f "$AC_PATH_APPS/../") else AC_PATH_ROOT=$(readlink -f "$AC_PATH_APPS/../") @@ -10,4 +19,3 @@ AC_PATH_CONF="$AC_PATH_ROOT/conf" AC_PATH_MODULES="$AC_PATH_ROOT/modules" AC_PATH_DEPS="$AC_PATH_ROOT/deps" - diff --git a/apps/ci/mac/ci-compile.sh b/apps/ci/mac/ci-compile.sh index 7f10ae8b5..0bce1ca6f 100755 --- a/apps/ci/mac/ci-compile.sh +++ b/apps/ci/mac/ci-compile.sh @@ -5,7 +5,7 @@ export CCACHE_MAXSIZE='2G' export CCACHE_COMPRESS=9 ccache -s -mkdir var/build/obj && cd var/build/obj; +cd var/build/obj time cmake ../../../ \ -DTOOLS=1 \ diff --git a/apps/ci/mac/ci-install.sh b/apps/ci/mac/ci-install.sh deleted file mode 100755 index bd6f84263..000000000 --- a/apps/ci/mac/ci-install.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -########################################## -## workaround to fix macos-10.15 configure os from failing -time brew reinstall openssl@1.1 -########################################## - -time brew update -time brew install openssl readline ace coreutils bash bash-completion mysql ccache - diff --git a/apps/installer/includes/os_configs/osx.sh b/apps/installer/includes/os_configs/osx.sh index a29f1846d..28f5c9bb2 100644 --- a/apps/installer/includes/os_configs/osx.sh +++ b/apps/installer/includes/os_configs/osx.sh @@ -1,6 +1,15 @@ -ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +########################################## +## workaround to fix macos-10.15 configure os from failing +brew reinstall openssl@1.1 +########################################## brew update -brew install openssl readline cmake ace coreutils bash bash-completion md5sha1sum curl unzip +########################################## +## workaround for cmake already being installed in the github runners +if ! command -v cmake &>/dev/null ; then + brew install cmake +fi +########################################## +brew install openssl readline ace bash-completion curl unzip mysql ccache