chore: Support pre-build grpc artefacts for CI jobs #14
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-file: .github/actions/environment_clang.yaml | |
cache-environment: true | |
create-args: ccache 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 | |
# fdebug-prefix-map is for ccache to not have absolute paths interfere with caching, see https://ccache.dev/manual/3.6.html#_compiling_in_different_directories | |
# -DCMAKE_CXX_FLAGS="${{ matrix.compiler.cxx == 'clang++' && '-stdlib=libc++ -std=c++20' || ''}} -fdebug-prefix-map=${{github.workspace}}/build=." | |
# -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.compiler.cxx == 'clang++' && '-stdlib=libc++ -lc++abi' || ''}}" | |
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}} | |
-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 | |