Skip to content

Commit

Permalink
Enhance GitHub Actions build plugin: add Bazel cache mounting and str…
Browse files Browse the repository at this point in the history
…eamline gRPC build process
  • Loading branch information
royshil committed Nov 27, 2024
1 parent 17b5122 commit e388efa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/actions/build-plugin/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,23 @@ runs:
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
brew install --quiet zsh
echo ::endgroup::
- name: Mount bazel cache
uses: actions/cache@v3
with:
path: "/home/runner/.cache/bazel"
key: bazel

- name: Build gRPC 🛠️
if: runner.os == 'Linux' || runner.os == 'macOS'
shell: bash
run: |
: Build gRPC 🛠️
echo ::group::Build gRPC
sudo apt-get install -y ccache gcc g++ || brew install ccache
git clone https://github.com/grpc/grpc.git --depth 1
cd grpc
git submodule update --init
bazel build --compilation_mode=opt --build_tag_filters="-protos" \
--repo_env=CC="$(if [[ "$RUNNER_OS" == "Linux" ]]; then echo /usr/bin/ccache /usr/bin/gcc; else echo ccache clang; fi)" \
--repo_env=CXX="$(if [[ "$RUNNER_OS" == "Linux" ]]; then echo /usr/bin/ccache /usr/bin/g++; else echo ccache clang++; fi)" \
@com_google_protobuf//:protoc @com_github_grpc_grpc//src/compiler:grpc_cpp_plugin
echo "GRPC_SOURCE_DIR=$(pwd)/include" >> $GITHUB_ENV
echo "GRPC_BUILD_DIR=$(bazel info output_base)" >> $GITHUB_ENV
Expand Down

0 comments on commit e388efa

Please sign in to comment.