chore: Add macOS build.

This commit is contained in:
iphydf 2021-12-28 23:25:34 +00:00
parent d8397c93c8
commit 8ce2ae0fcb
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
3 changed files with 32 additions and 36 deletions

View File

@ -13,6 +13,7 @@ branches:
required_status_checks:
contexts:
- build-bootstrapd-docker
- build-macos
- build-nacl
- build-win32
- build-win64

View File

@ -44,3 +44,10 @@ jobs:
- uses: actions/checkout@v2
- name: Build on FreeBSD
run: .travis/cmake-freebsd-stage2
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Build and test
run: .travis/cmake-osx

View File

@ -1,28 +1,23 @@
#!/bin/bash
ACTION="$1"
set -eu
CACHEDIR="$HOME/cache"
NPROC=$(sysctl -n hw.physicalcpu)
travis_install() {
# Workaround for bug in Homebrew where it only finds an old Ruby version.
brew update
# Workaround for bug in Homebrew where it only finds an old Ruby version.
brew update
brew install libsodium libvpx opus libconfig
}
brew install libconfig libsodium libvpx opus
travis_script() {
. ".travis/flags-$CC.sh"
. ".travis/flags-clang.sh"
add_ld_flag -undefined error
add_ld_flag -undefined error
# Make compilation error on a warning
add_flag -Werror
# Make compilation error on a warning
add_flag -Werror
cmake -B_build -H. \
cmake -B_build -H. \
-DCMAKE_C_FLAGS="$C_FLAGS" \
-DCMAKE_CXX_FLAGS="$CXX_FLAGS" \
-DCMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \
@ -35,15 +30,8 @@ travis_script() {
-DUSE_IPV6=OFF \
-DAUTOTEST=ON
cd _build # pushd
make "-j$NPROC" -k install
make "-j$NPROC" test ARGS="-j50" ||
cd _build # pushd
make "-j$NPROC" -k install
make "-j$NPROC" test ARGS="-j50" ||
make "-j$NPROC" test ARGS="-j50 --rerun-failed" CTEST_OUTPUT_ON_FAILURE=1
cd - # popd
}
if [ "-z" "$ACTION" ]; then
"travis_script"
else
"travis_$ACTION"
fi
cd - # popd