diff options
author | Sjors Provoost <sjors@sprovoost.nl> | 2019-10-14 23:00:49 +0200 |
---|---|---|
committer | Sjors Provoost <sjors@sprovoost.nl> | 2019-10-14 23:00:49 +0200 |
commit | 1f6c650c99eb94fdd0cbdd528aa3405201de08c2 (patch) | |
tree | 17f9520cf4d995dafe94902119afb13bdf583d55 /ci/test/04_install.sh | |
parent | 42d0eca725a83c999e2b67e33dfc7bcc96288dc3 (diff) |
travis: run tests on macOS native
Review hint:
git show -w
Co-authored-by: MarcoFalke <falke.marco@gmail.com>
Co-authored-by: keneanung <keneanung@googlemail.com>
Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>
Diffstat (limited to 'ci/test/04_install.sh')
-rwxr-xr-x | ci/test/04_install.sh | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index 409e87ce04..1578e3c0b4 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -6,6 +6,32 @@ export LC_ALL=C.UTF-8 +if [ "$TRAVIS_OS_NAME" == "osx" ]; then + set +o errexit + pushd /usr/local/Homebrew || exit 1 + git reset --hard origin/master + popd || exit 1 + set -o errexit + ${CI_RETRY_EXE} brew update + # brew upgrade returns an error if any of the packages is already up to date + # Failure is safe to ignore, unless we really need an update. + brew upgrade $BREW_PACKAGES || true + + # install new packages (brew install returns an error if already installed) + for i in $BREW_PACKAGES; do + if ! brew list | grep -q $i; then + ${CI_RETRY_EXE} brew install $i + fi + done + + export PATH="/usr/local/opt/ccache/libexec:$PATH" + OPENSSL_PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig" + export PKG_CONFIG_PATH=$OPENSSL_PKG_CONFIG_PATH:$PKG_CONFIG_PATH + + ${CI_RETRY_EXE} pip3 install $PIP_PACKAGES + +fi + mkdir -p "${BASE_SCRATCH_DIR}" ccache echo "Creating ccache dir if it didn't already exist" @@ -42,11 +68,19 @@ else } fi -DOCKER_EXEC free -m -h -DOCKER_EXEC echo "Number of CPUs \(nproc\):" \$\(nproc\) +if [ "$TRAVIS_OS_NAME" == "osx" ]; then + top -l 1 -s 0 | awk ' /PhysMem/ {print}' + echo "Number of CPUs: $(sysctl -n hw.logicalcpu)" +else + DOCKER_EXEC free -m -h + DOCKER_EXEC echo "Number of CPUs \(nproc\):" \$\(nproc\) +fi -${CI_RETRY_EXE} DOCKER_EXEC apt-get update -${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -y $PACKAGES $DOCKER_PACKAGES + +if [ "$TRAVIS_OS_NAME" != "osx" ]; then + ${CI_RETRY_EXE} DOCKER_EXEC apt-get update + ${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -y $PACKAGES $DOCKER_PACKAGES +fi if [ "$USE_BUSY_BOX" = "true" ]; then echo "Setup to use BusyBox utils" |