forked from apache/brpc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3ffb80
commit ee446ee
Showing
1 changed file
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |