Skip to content

Commit

Permalink
Macos workflow (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
guodongxiaren committed Aug 31, 2022
1 parent 6457ad7 commit eb83f87
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/ci_macos.yml
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

0 comments on commit eb83f87

Please sign in to comment.