Skip to content

Commit

Permalink
Support Clang compile for Linux workflow (#2015)
Browse files Browse the repository at this point in the history
* clang

* mergefile

* bazel
  • Loading branch information
guodongxiaren authored Nov 25, 2022
1 parent b3955e9 commit 93a49cd
Showing 1 changed file with 59 additions and 5 deletions.
64 changes: 59 additions & 5 deletions .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
proc_num: $(nproc)

jobs:
compile-with-make:
gcc-compile-with-make:
runs-on: ubuntu-latest # https://github.com/actions/runner-images

steps:
Expand All @@ -19,14 +19,64 @@ jobs:
- name: install dependences
run: |
sudo apt-get install -y git g++ make libssl-dev libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev libgoogle-perftools-dev
- name: config_brpc
- name: config brpc
run: |
./config_brpc.sh --header="/usr/local/include /usr/include" --libs="/usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64"
- name: compile
run: |
make -j ${{env.proc_num}}
gcc-compile-with-cmake:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: install dependences
run: |
sudo apt-get install -y git g++ make libssl-dev libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev
- name: cmake
run: |
mkdir build
cd build
cmake ..
- name: compile
run: |
cd build
make -j ${{env.proc_num}}
gcc-compile-with-bazel:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: install dependences
run: |
sudo apt-get update
sudo apt-get install libibverbs-dev
- name: compile
run: |
bazel build -j ${{env.proc_num}} -c opt --copt -DHAVE_ZLIB=1 //...
compile-with-cmake:
clang-compile-with-make:
runs-on: ubuntu-latest # https://github.com/actions/runner-images

steps:
- uses: actions/checkout@v2

- name: install dependences
run: |
sudo apt-get install -y git g++ make libssl-dev libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev libgoogle-perftools-dev
- name: config brpc
run: |
./config_brpc.sh --header="/usr/local/include /usr/include" --libs="/usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64" --nodebugsymbols --cxx=clang++ --cc=clang
- name: compile
run: |
make -j ${{env.proc_num}}
clang-compile-with-cmake:
runs-on: ubuntu-latest

steps:
Expand All @@ -37,15 +87,17 @@ jobs:
sudo apt-get install -y git g++ make libssl-dev libgflags-dev libprotobuf-dev libprotoc-dev protobuf-compiler libleveldb-dev
- name: cmake
run: |
export CC=clang
export CXX=clang++
mkdir build
cd build
cmake ..
- name: compile
run: |
cd build
make -j ${{env.proc_num}}
compile-with-bazel:
clang-compile-with-bazel:
runs-on: ubuntu-latest

steps:
Expand All @@ -57,4 +109,6 @@ jobs:
sudo apt-get install libibverbs-dev
- name: compile
run: |
export CC=clang
export CXX=clang++
bazel build -j ${{env.proc_num}} -c opt --copt -DHAVE_ZLIB=1 //...

0 comments on commit 93a49cd

Please sign in to comment.