Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macos workflow #10

Merged
merged 26 commits into from
Aug 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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