diff --git a/.github/workflows/ci_macos.yml b/.github/workflows/ci_macos.yml new file mode 100644 index 0000000000..cf253c760e --- /dev/null +++ b/.github/workflows/ci_macos.yml @@ -0,0 +1,92 @@ +name: Build and Test on Macos + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + proc_num: $(sysctl -n hw.logicalcpu) + +jobs: + compile-with-make: + runs-on: macos-latest # https://github.com/actions/runner-images + + steps: + - uses: actions/checkout@v2 + + - name: intall dependences + run: | + brew install openssl gnu-getopt coreutils gflags protobuf leveldb + + - name: config_brpc + run: | + GETOPT_PATH=$(find "/usr/local/Cellar/" -name "getopt" -type f -perm +111 -exec dirname {} \;) + export PATH=$GETOPT_PATH:$PATH + ./config_brpc.sh --header="/usr/local/include" --libs="/usr/local/lib" + + - name: compile + run: | + make -j ${{env.proc_num}} + + compile-with-cmake: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + + - name: intall dependences + run: | + brew install openssl gnu-getopt coreutils gflags protobuf leveldb + + - name: cmake + run: | + mkdir build + cd build + cmake .. + + - name: compile + run: | + cd build + make -j ${{env.proc_num}} + + compile-with-bazel: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + + - name: intall dependences + run: | + brew install openssl gnu-getopt coreutils gflags protobuf leveldb + + - name: compile + run: | + bazel build -j ${{env.proc_num}} -c opt --copt -DHAVE_ZLIB=1 //... + + unittest: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + + - name: intall dependences + run: | + brew install openssl gnu-getopt coreutils gflags protobuf leveldb googletest + + - name: config_brpc + run: | + GETOPT_PATH=$(find "/usr/local/Cellar/" -name "getopt" -type f -perm +111 -exec dirname {} \;) + export PATH=$GETOPT_PATH:$PATH + ./config_brpc.sh --header="/usr/local/include" --libs="/usr/local/lib" + + - name: compile + run: | + cd test + make -j ${{env.proc_num}} + + - name: test + run: | + cd test + sh run_tests.sh