-
Notifications
You must be signed in to change notification settings - Fork 11
162 lines (147 loc) Β· 4.83 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
linux:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow_ref }}-${{ github.job }}_${{ matrix.container }}-${{ matrix.compiler }}-${{ matrix.variant }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
compiler:
- clang++
- g++
container:
- ubuntu:24.04
variant:
- asio
- libuv
include:
- compiler: g++
dependencies: g++
- compiler: clang++
dependencies: clang
- variant: asio
cmake_args: -DGRPCXX_USE_ASIO=ON
steps:
- name: Install dependencies
run: |
apt-get update
apt-get install -y --no-install-recommends \
${{ matrix.dependencies }} \
cmake ninja-build \
libprotobuf-dev libprotoc-dev protobuf-compiler
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: .build
key: ${{ runner.arch }}_${{ matrix.container }}-${{ matrix.compiler }}-${{ matrix.variant }}-${{ hashFiles('cmake/dependencies.cmake') }}
- name: Configure CMake
run: |
cmake -B .build -G Ninja \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DGRPCXX_BUILD_TESTING=OFF \
${{ matrix.cmake_args }}
- name: Build
run: |
cmake --build .build --config Release
macos:
runs-on: macos-latest
concurrency:
group: ${{ github.workflow_ref }}-${{ github.job }}_${{ matrix.compiler }}-${{ matrix.variant }}
strategy:
fail-fast: false
matrix:
compiler:
- clang++
- g++
variant:
- boost_asio
- libuv
include:
- variant: boost_asio
cmake_args: -DGRPCXX_USE_ASIO=ON
dependencies: boost
steps:
- name: Install dependencies
run: |
brew install \
protobuf \
ninja \
${{ matrix.dependencies }}
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: .build
key: ${{ runner.arch }}_${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.variant }}-${{ hashFiles('cmake/dependencies.cmake') }}
- name: Configure CMake
run: |
cmake -B .build -G Ninja \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DGRPCXX_BUILD_TESTING=OFF \
${{ matrix.cmake_args }}
- name: Build
run: |
cmake --build .build --config Release
windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
compiler:
- cl
variant:
# [Nov. 2024] msvc throws C2894 errors when using libuv, need to investigate why
# Ref: https://github.com/uatuko/grpcxx/pull/46
# - libuv
- asio
include:
- variant: asio
cmake_args: -DGRPCXX_USE_ASIO=ON
steps:
- uses: actions/cache/restore@v4
id: cache-restore-vcpkg
with:
path: C:\vcpkg\packages
key: ${{ runner.arch }}_${{ runner.os }}-vcpkg-20241101
- name: Install dependencies (choco)
run: choco install ninja
- name: Install dependencies (vcpkg)
if: steps.cache-restore-vcpkg.outputs.cache-hit != 'true'
run: vcpkg install protobuf
# Always save vcpkg cache if vcpkg install is successful
- uses: actions/cache/save@v4
if: always() && steps.cache-restore-vcpkg.outputs.cache-hit != 'true'
id: cache-save-vcpkg
with:
path: C:\vcpkg\packages
key: ${{ steps.cache-restore-vcpkg.outputs.cache-primary-key }}
# It's not straight forward to setup dev commant prompt to use across steps. Have to find the location and execute
# `vcvarsall.bat ${{ runner.arch }}` and "export" env vars set by vcvarsall.bat.
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/checkout@v4
- name: Configure CMake
run: |
cmake -B .build -G Ninja `
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }} `
-DCMAKE_BUILD_TYPE=Release `
-DBUILD_SHARED_LIBS=ON `
-DGRPCXX_BUILD_EXAMPLES=OFF `
-DGRPCXX_BUILD_EXPERIMENTS=OFF `
-DGRPCXX_BUILD_TESTING=OFF `
-DProtobuf_ROOT=C:\vcpkg\packages\protobuf_x64-windows `
-DCMAKE_CXX_FLAGS="-DNGHTTP2_NO_SSIZE_T -IC:\vcpkg\packages\abseil_x64-windows\include" `
${{ matrix.cmake_args }}
- name: Build
run: cmake --build .build --config Release