Repository navigation
319 lines (278 loc) · 12.1 KB
/
Copy pathci-pr.yml
File metadata and controls
319 lines (278 loc) · 12.1 KB
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
name: Build PR
on:
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryhandler.count=5 -Dmaven.wagon.httpconnectionManager.ttlSeconds=240
# Cancel running jobs when a new push happens to the same branch as otherwise it will
# tie up too many resources without providing much value.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-pr:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- setup: centos6-x86_64
docker-compose-run: "-f docker/docker-compose.centos-6.yaml -f docker/docker-compose.centos-6.18.yaml run build"
docker-bake-args: "-f docker-compose.centos-6.yaml -f docker-compose.centos-6.18.yaml"
- setup: debian7-x86_64
docker-compose-run: "-f docker/docker-compose.debian.yaml -f docker/docker-compose.debian-7.18.yaml run build-dynamic-only"
docker-bake-args: "-f docker-compose.debian.yaml -f docker-compose.debian-7.18.yaml"
- setup: centos7-aarch64
docker-compose-run: "-f docker/docker-compose.centos-7.yaml run cross-compile-aarch64-build"
docker-bake-args: "-f docker-compose.centos-7.yaml"
- setup: al2023-x86_64-aws_lc
docker-compose-run: "-f docker/docker-compose.al2023.yaml run build"
docker-bake-args: "-f docker-compose.al2023.yaml"
name: ${{ matrix.setup }}
permissions:
contents: read
packages: write # to push the docker build cache to ghcr.io; no-op (ignored) for fork PRs
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
# Only succeeds for same-repo runs; fork PRs get a read-only GITHUB_TOKEN and simply won't
# get cache hits/pushes, which is fine since it only means a slower, non-cached build.
- name: Log in to GitHub Container Registry
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
continue-on-error: true
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Cache .m2/repository
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
with:
path: ~/.m2/repository
key: build-pr-${{ matrix.setup }}-m2-repository-cache-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-pr-${{ matrix.setup }}-m2-repository-cache-
- name: Extract OpenSSL version from pom.xml
run: echo "OPENSSL_VERSION=$(./mvnw -q -Dexpression=opensslVersion -DforceStdout -N help:evaluate --no-transfer-progress)" >> $GITHUB_ENV
- name: Extract OpenSSL SHA256 from pom.xml
run: echo "OPENSSL_SHA256=$(./mvnw -q -Dexpression=opensslSha256 -DforceStdout -N help:evaluate --no-transfer-progress)" >> $GITHUB_ENV
- name: Build docker image
working-directory: docker
env:
BUILDX_BAKE_ENTITLEMENTS_FS: "0"
run: docker buildx bake ${{ matrix.docker-bake-args }} --load
- name: Build project
run: docker compose ${{ matrix.docker-compose-run }} | tee build.output
- name: Checking for test failures
run: ./.github/scripts/check_build_result.sh build.output
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ always() }}
with:
name: build-pr-${{ matrix.setup }}-jars
path: |
**/target/*.jar
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ failure() }}
with:
name: build-pr-${{ matrix.setup }}-target
path: |
**/target/surefire-reports/
**/hs_err*.log
build-pr-windows:
runs-on: windows-2022
name: windows-x86_64
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up JDK 8
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
java-version: 8
distribution: zulu
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3.0.0
- name: Configuring Developer Command Prompt
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: x86_amd64
- name: Install tools
uses: crazy-max/ghaction-chocolatey@dfdcf5bba9c0a16358a21c13a06ec5c89024b3ac # v4.1.0
with:
args: install ninja nasm
# Cache .m2/repository
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
with:
path: ~/.m2/repository
key: build-pr-windows-m2-repository-cache-${{ hashFiles('**/pom.xml') }}
restore-keys: |
build-pr-windows-m2-repository-cache-
- name: Build netty-tcnative-boringssl-static
run: ./mvnw.cmd --file pom.xml -am -pl boringssl-static clean package
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ always() }}
with:
name: build-pr-windows-jars
path: |
**/target/*.jar
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ failure() }}
with:
name: build-pr-windows-target
path: |
**/target/surefire-reports/
**/hs_err*.log
build-pr-macos:
strategy:
fail-fast: false
matrix:
include:
- setup: macos-x86_64
os: macos-15-intel
- setup: macos-aarch64
os: macos-15
runs-on: ${{ matrix.os }}
name: ${{ matrix.setup }} build
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up JDK 8
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
distribution: 'zulu'
java-version: '8'
# Cache .m2/repository
# Caching of maven dependencies
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
continue-on-error: true
with:
path: ~/.m2/repository
key: pr-${{ matrix.setup }}-maven-cache-${{ hashFiles('**/pom.xml') }}
restore-keys: |
pr-${{ matrix.setup }}-maven-cache-
- name: Install tools via brew
run: brew bundle
- name: Build project
run: ./mvnw -B -ntp --file pom.xml -am -pl openssl-dynamic,boringssl-static clean package
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ always() }}
with:
name: build-pr-${{ matrix.setup }}-jars
path: |
**/target/*.jar
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ failure() }}
with:
name: build-pr-${{ matrix.setup }}-target
path: |
**/target/surefire-reports/
**/hs_err*.log
# Verify that the glibc-built Linux artifacts really load under musl. This consumes the jars
# the build jobs above already upload, so nothing is rebuilt. The static half of this invariant
# is enforced inside the build by scripts/check_musl_compat.sh; what only a real musl system can
# show is whether the library loads, because on aarch64 the historical failure was a JVM SIGSEGV
# during dlopen rather than an UnsatisfiedLinkError. See docs/musl-compatibility.md.
#
# `needs` cannot depend on a single matrix leg, so this waits for all of build-pr.
#
# The gcompat legs are not expected to change the answer -- libc.so.6 is one of the names musl
# resolves internally, so gcompat's symlink is never read. They earn their place by making a
# bare failure diagnostic: if bare fails and gcompat passes, the artifact has re-acquired a
# dependency on the compatibility shim, which is exactly how 2.0.65 appeared to work.
musl-verify:
needs: build-pr
strategy:
fail-fast: false
matrix:
include:
# Both runners are pinned: there is no ubuntu-latest-arm, so pairing ubuntu-latest with
# a pinned arm label would drift apart as soon as ubuntu-latest moves on. The host only
# supplies Docker here, so pinning costs nothing.
- setup: alpine-x86_64
os: ubuntu-24.04
jars: build-pr-centos6-x86_64-jars
variant: bare
extra-pkgs: ""
drop-elftools: "1"
build-service: runtime-setup
run-service: verify
- setup: alpine-aarch64
os: ubuntu-24.04-arm
jars: build-pr-centos7-aarch64-jars
variant: bare
extra-pkgs: ""
drop-elftools: "1"
build-service: runtime-setup
run-service: verify
# The invariant leg: an Alpine JDK that ships no `libgcc` package of its own, so
# `apk del .elftools` really does leave libgcc absent. eclipse-temurin's JDK depends on
# libgcc, so the bare legs above cannot prove the artifact loads without it.
- setup: alpine-x86_64-nolibgcc
os: ubuntu-24.04
jars: build-pr-centos6-x86_64-jars
variant: nolibgcc
extra-pkgs: ""
drop-elftools: "1"
jdk-image: amazoncorretto:21-alpine
build-service: runtime-setup
run-service: verify
- setup: alpine-aarch64-nolibgcc
os: ubuntu-24.04-arm
jars: build-pr-centos7-aarch64-jars
variant: nolibgcc
extra-pkgs: ""
drop-elftools: "1"
jdk-image: amazoncorretto:21-alpine
build-service: runtime-setup
run-service: verify
- setup: alpine-x86_64-gcompat
os: ubuntu-24.04
jars: build-pr-centos6-x86_64-jars
variant: gcompat
extra-pkgs: gcompat
drop-elftools: "0"
build-service: runtime-setup
run-service: verify
- setup: alpine-aarch64-gcompat
os: ubuntu-24.04-arm
jars: build-pr-centos7-aarch64-jars
variant: gcompat
extra-pkgs: gcompat
drop-elftools: "0"
build-service: runtime-setup
run-service: verify
# Control: anything failing on Alpine must pass here, or the check is at fault rather
# than the artifact.
- setup: glibc-control-x86_64
os: ubuntu-24.04
jars: build-pr-centos6-x86_64-jars
variant: glibc-control
extra-pkgs: ""
drop-elftools: "0"
build-service: control-runtime-setup
run-service: control-verify
runs-on: ${{ matrix.os }}
name: musl-verify ${{ matrix.setup }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ matrix.jars }}
path: musl-verify-jars
- name: Build verification image
env:
MUSL_VARIANT: ${{ matrix.variant }}
MUSL_EXTRA_PKGS: ${{ matrix.extra-pkgs }}
MUSL_JDK_IMAGE: ${{ matrix.jdk-image }}
run: docker compose -f docker/docker-compose.alpine.yaml build ${{ matrix.build-service }}
- name: Verify the artifact under ${{ matrix.variant }}
env:
MUSL_VARIANT: ${{ matrix.variant }}
MUSL_EXTRA_PKGS: ${{ matrix.extra-pkgs }}
MUSL_DROP_ELFTOOLS: ${{ matrix.drop-elftools }}
MUSL_JDK_IMAGE: ${{ matrix.jdk-image }}
MUSL_JARS_DIR: musl-verify-jars
run: docker compose -f docker/docker-compose.alpine.yaml run --rm ${{ matrix.run-service }}