-
Notifications
You must be signed in to change notification settings - Fork 46
335 lines (292 loc) · 10.9 KB
/
build-pr.yml
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
#
# Workflow: Build&Test PR for Hazelcast organization members
# This workflow builds multiple configurations for MacOS, Windows, Ubuntu i386 and Ubuntu x64
# If all the builds and tests are success, the PR can be merged.
# It also runs code-coverage and upload the result as an artifact.
name: Build&Test PR
on:
# automatic on every pull request
pull_request_target:
# manual (for community PRs that we want to force-run here)
workflow_dispatch:
inputs:
# the PR number eg 712
pr_number:
description: Enter guest PR number to run test & coverage on it.
required: true
# the PR HEAD commit SHA which MUST have been verified
pr_commit:
description: Enter guest PR verified HEAD commit SHA.
required: true
env:
boost_version: 1.78.0
boost_archive_name: 'boost_1_78_0.tar.gz'
boost_folder_name: 'boost_1_78_0'
boost_include_folder: 'C:\Boost\include\boost-1_78'
boost_url: 'https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.gz'
thrift_version: 0.13.0
run_tests: false
jobs:
# test hazelcast membership
test-membership:
name: Test Hazelcast Membership
runs-on: ubuntu-latest
outputs:
is-hazelcast: ${{ steps.test-membership.outputs.is-member }}
steps:
# checkout the hazelcast/hazelcast-cpp-client repository
# bare minimum - just to use actions
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
token: ${{ secrets.GH_TOKEN }}
submodules: false
- name: Test
id: test-membership
uses: ./.github/actions/test-membership
with:
organization-name: hazelcast
member-name: ${{ github.actor }}
token: ${{ secrets.GH_TOKEN }}
# ensure we are an Hazelcast organization member OR manually running
ensure-membership:
name: Ensure Membership
runs-on: ubuntu-latest
needs: test-membership
strategy:
fail-fast: false
if: needs.test-membership.outputs.is-hazelcast == 'true' || github.event_name == 'workflow_dispatch'
steps:
- name: Report
shell: bash
run: echo "User ${{ github.event.pull_request.head.repo.owner.login }} is a member of the Hazelcast organization"
# get
get-refs:
name: Get Refs
runs-on: ubuntu-latest
needs: ensure-membership
outputs:
ref: ${{ steps.get-refs.outputs.ref }}
merged-ref: ${{ steps.get-refs.outputs.merged-ref }}
steps:
- name: Get Refs
id: get-refs
shell: bash
run: |
echo "EVENT: ${{ github.event_name }}"
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "PR_NUMBER: ${{ inputs.pr_number }}"
echo "PR_COMMIT: ${{ inputs.pr_commit }}"
echo "ref=refs/pull/${{ inputs.pr_number }}/merge" >> $GITHUB_OUTPUT
echo "merged-ref=${{ inputs.pr_commit }}" >> $GITHUB_OUTPUT
else
echo "PR_NUMBER: ${{ github.event.pull_request.number }}"
echo "ref=refs/pull/${{ github.event.pull_request.number }}/merge" >> $GITHUB_OUTPUT
echo "merged-ref=''" >> $GITHUB_OUTPUT
fi
# run for code-coverage and upload the result as an artifact.
code-coverage:
runs-on: ubuntu-latest
needs: get-refs
name: Code Coverage
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ needs.get-refs.outputs.ref }}
token: ${{ secrets.GH_TOKEN }}
- uses: ./.github/actions/coverage-report
with:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BOOST_VERSION: ${{ env.boost_version }}
THRIFT_VERSION: ${{ env.thrift_version }}
RUN_TESTS: ${{ env.run_tests }}
HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}
Ubuntu-i386:
needs: get-refs
strategy:
fail-fast: false
matrix:
build_type:
- type: Debug
warn_as_err: ON
- type: Release
warn_as_err: OFF
shared_libs:
- toggle: OFF
name: Static
- toggle: ON
name: Shared
with_openssl:
- toggle: OFF
name: 'noSSL'
- toggle: ON
name: 'SSL'
runs-on: ubuntu-latest
container:
image: i386/ubuntu
options: --privileged
name: ubuntu-i386-(${{ matrix.build_type.type }}, ${{ matrix.shared_libs.name }}, ${{ matrix.with_openssl.name }})
steps:
- name: Checkout Code
uses: actions/checkout@v1
with:
ref: ${{ needs.get-refs.outputs.ref }}
token: ${{ secrets.GH_TOKEN }}
- uses: ./.github/actions/build-test/ubuntu-i386
with:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BOOST_VERSION: ${{ env.boost_version }}
THRIFT_VERSION: ${{ env.thrift_version }}
WARN_AS_ERR: ${{ matrix.build_type.warn_as_err }}
BUILD_TYPE: ${{ matrix.build_type.type }}
SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }}
OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }}
RUN_TESTS: ${{ env.run_tests }}
HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}
Ubuntu-x86_64:
needs: get-refs
strategy:
fail-fast: false
matrix:
build_type:
- type: Debug
warn_as_err: ON
- type: Release
warn_as_err: OFF
shared_libs:
- toggle: OFF
name: Static
- toggle: ON
name: Shared
with_openssl:
- toggle: OFF
name: noSSL
- toggle: ON
name: SSL
runs-on: ubuntu-latest
name: ubuntu-x64-(${{ matrix.build_type.type }}, ${{ matrix.shared_libs.name }}, ${{ matrix.with_openssl.name }})
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.get-refs.outputs.ref }}
token: ${{ secrets.GH_TOKEN }}
- uses: ./.github/actions/build-test/ubuntu-x86_64
with:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BOOST_VERSION: ${{ env.boost_version }}
THRIFT_VERSION: ${{ env.thrift_version }}
WARN_AS_ERR: ${{ matrix.build_type.warn_as_err }}
BUILD_TYPE: ${{ matrix.build_type.type }}
SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }}
OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }}
RUN_TESTS: ${{ env.run_tests }}
HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}
Windows:
needs: get-refs
strategy:
fail-fast: false
matrix:
arch:
- cmake: Win32
choco_options: '--forceX86 --x86 --version 1.1.1.2100 -y'
address_model: 32
- cmake: x64
choco_options: ''
address_model: 64
build_type:
- Debug
- Release
shared_libs:
- toggle: OFF
name: Static
- toggle: ON
name: Shared
with_openssl:
- toggle: OFF
name: 'noSSL'
- toggle: ON
name: 'SSL'
runs-on: 'windows-latest'
env:
JOB_NAME: win_${{ matrix.arch.address_model }}_${{ matrix.build_type.short }}_${{ matrix.shared_libs.name }}_${{ matrix.with_openssl.name }}
name: win-${{ matrix.arch.address_model }}_${{ matrix.shared_libs.name }}_${{ matrix.with_openssl.name }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.get-refs.outputs.ref }}
token: ${{ secrets.GH_TOKEN }}
- uses: ./.github/actions/build-test/windows
with:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BOOST_VERSION: ${{ env.boost_version }}
THRIFT_VERSION: ${{ env.thrift_version }}
BUILD_TYPE: ${{ matrix.build_type }}
SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }}
OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }}
ARCH_CHOCO_OPTIONS: ${{ matrix.arch.choco_options }}
ARCH_ADDRESS_MODEL: ${{ matrix.arch.address_model }}
ARCH_CMAKE: ${{ matrix.arch.cmake }}
INSTALL_BOOST: true
BOOST_URL: ${{ env.boost_url }}
BOOST_ARCHIVE_NAME: ${{ env.boost_archive_name }}
BOOST_FOLDER_NAME: ${{ env.boost_folder_name }}
BOOST_INCLUDE_FOLDER: ${{ env.boost_include_folder }}
INSTALL_THRIFT: true
RUN_TESTS: ${{ env.run_tests }}
HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}
macOS-x86_64:
needs: get-refs
strategy:
fail-fast: false
matrix:
build_type:
- type: Debug
warn_as_err: ON
- type: Release
warn_as_err: OFF
shared_libs:
- toggle: OFF
name: Static
- toggle: ON
name: Shared
with_openssl:
- toggle: OFF
name: 'noSSL'
- toggle: ON
name: 'SSL'
runs-on: macos-latest
name: macOS-(${{ matrix.build_type.type }}, ${{ matrix.shared_libs.name }}, ${{ matrix.with_openssl.name }})
env:
OPENSSL_ROOT_DIR: /usr/local/opt/openssl/
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.get-refs.outputs.ref }}
token: ${{ secrets.GH_TOKEN }}
- uses: ./.github/actions/build-test/macos-x86_64
with:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BOOST_VERSION: ${{ env.boost_version }}
WARN_AS_ERR: ${{ matrix.build_type.warn_as_err }}
BUILD_TYPE: ${{ matrix.build_type.type }}
SHARED_LIBS_TOGGLE: ${{ matrix.shared_libs.toggle }}
OPENSSL_TOGGLE: ${{ matrix.with_openssl.toggle }}
RUN_TESTS: ${{ env.run_tests }}
HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}