Skip to content

chore: Support pre-build grpc artefacts for CI jobs #18

chore: Support pre-build grpc artefacts for CI jobs

chore: Support pre-build grpc artefacts for CI jobs #18

name: Build Dependencies
on:
schedule:
- cron: '0 0 1 * *' # Run at midnight on the first of every month
workflow_dispatch:
pull_request:
branches: main
concurrency:
group: grpc-build
cancel-in-progress: true
jobs:
build_grpc:
name: Build gRPC artifacts
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
build-type: [ Release, Debug ]
compiler:
# - { c: gcc, cxx: g++, version: 11 } # TODO revert
# - { c: gcc, cxx: g++, version: 12 }
- { c: clang, cxx: clang++, version: 14 }
- { c: clang, cxx: clang++, version: 17, coverage: true }
include:
# Currently, there is a linking error with zlib if we use clang 16 for sanitizers
# Let's investigate this when clang > 14 is os default - one problem could be the external clang installation
- compiler: {c: clang, cxx: clang++, version: 14}
build-type: Tsan
- compiler: {c: clang, cxx: clang++, version: 14}
build-type: Asan
exclude:
# gcc-12 causes a false-positive memory error in release (https://github.com/google/googletest/issues/4108)
- compiler: { c: gcc, cxx: g++, version: 12 }
build-type: Release
steps:
- name: Check out grpc codebase
uses: actions/checkout@v4
with:
repository: grpc/grpc
ref: v1.59.2
submodules: true
fetch-depth: 1
- name: Install clang environment
uses: mamba-org/setup-micromamba@v1
with:
environment-name: clang
cache-environment: true
create-args: clang=${{matrix.compiler.version}} libclang=${{matrix.compiler.version}} clang-tools=${{matrix.compiler.version}}
# gcc_linux-64=${{matrix.compiler.version}} gxx_linux-64=${{matrix.compiler.version}}
- name: Create build and artifact directories
run: |
mkdir -p ${{github.workspace}}/cmake/build
mkdir -p ${{github.workspace}}/install
- name: Configure CMake
working-directory: ${{github.workspace}}/cmake/build
run: >
cmake
-G "Unix Makefiles"
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install"
-DCMAKE_BUILD_TYPE=${{matrix.build-type}}
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DCMAKE_CXX_FLAGS="${{ matrix.compiler.cxx == 'clang++' && '-stdlib=libc++ -std=c++20' || ''}} -fdebug-prefix-map=${{github.workspace}}/build=."
-DCMAKE_CXX_STANDARD_LIBRARIES="${{ matrix.compiler.cxx == 'clang++' && '-lc++ -lc++abi' || ''}}"
-DgRPC_PROTOBUF_PROVIDER=module
-DABSL_ENABLE_INSTALL=On
-DgRPC_INSTALL=ON
-DgRPC_BUILD_CSHARP_EXT=Off
-DABSL_BUILD_TESTING=Off
-DgRPC_BUILD_TESTS=Off
${{github.workspace}}
- name: Build
working-directory: ${{github.workspace}}/cmake/build
run: make && make install
- name: Store binaries
uses: actions/upload-artifact@v4
with:
name: grpc-binaries-${{matrix.compiler.c}}-${{matrix.compiler.cxx}}-${{matrix.compiler.version}}-${{matrix.build-type}}
path: ${{github.workspace}}/install
if-no-files-found: error
overwrite: true
retention-days: 90