2
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
# This code is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 2 only, as
7
# published by the Free Software Foundation. Oracle designates this
8
# particular file as subject to the "Classpath" exception as provided
9
# by Oracle in the LICENSE file that accompanied this code.
11
# This code is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
# version 2 for more details (a copy is included in the LICENSE file that
15
# accompanied this code).
17
# You should have received a copy of the GNU General Public License version
18
# 2 along with this work; if not, write to the Free Software Foundation,
19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
# or visit www.oracle.com if you need additional information or have any
26
name: 'OpenJDK GHA Sanity Checks'
37
description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")'
39
default: 'linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
41
description: 'Additional configure arguments'
44
description: 'Additional make arguments'
48
group: ${{ github.workflow }}-${{ github.ref }}
49
cancel-in-progress: true
54
### Determine platforms to include
58
name: 'Select platforms'
61
linux-x64: ${{ steps.include.outputs.linux-x64 }}
62
linux-x86: ${{ steps.include.outputs.linux-x86 }}
63
linux-x64-variants: ${{ steps.include.outputs.linux-x64-variants }}
64
linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }}
65
macos-x64: ${{ steps.include.outputs.macos-x64 }}
66
macos-aarch64: ${{ steps.include.outputs.macos-aarch64 }}
67
windows-x64: ${{ steps.include.outputs.windows-x64 }}
68
windows-aarch64: ${{ steps.include.outputs.windows-aarch64 }}
69
docs: ${{ steps.include.outputs.docs }}
72
# This function must be inlined in main.yml, or we'd be forced to checkout the repo
73
- name: 'Check what jobs to run'
76
# Determine which platform jobs to run
78
# Returns 'true' if the input platform list matches any of the platform monikers given as argument,
80
# arg $1: platform name or names to look for
81
function check_platform() {
82
if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
83
input='${{ github.event.inputs.platforms }}'
84
elif [[ $GITHUB_EVENT_NAME == push ]]; then
85
if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then
86
# If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything
87
>&2 echo 'JDK_SUBMIT_FILTER is set and not a "submit/" branch'
91
input='${{ secrets.JDK_SUBMIT_PLATFORMS }}'
95
normalized_input="$(echo ,$input, | tr -d ' ')"
96
if [[ "$normalized_input" == ",," ]]; then
97
# For an empty input, assume all platforms should run
101
# Check for all acceptable platform names
103
if echo "$normalized_input" | grep -q -e ",$part," ; then
113
echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
114
echo "linux-x86=$(check_platform linux-x86 linux x86)" >> $GITHUB_OUTPUT
115
echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
116
echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
117
echo "macos-x64=$(check_platform macos-x64 macos x64)" >> $GITHUB_OUTPUT
118
echo "macos-aarch64=$(check_platform macos-aarch64 macos aarch64)" >> $GITHUB_OUTPUT
119
echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
120
echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT
121
echo "docs=$(check_platform docs)" >> $GITHUB_OUTPUT
130
uses: ./.github/workflows/build-linux.yml
133
gcc-major-version: '10'
134
configure-arguments: ${{ github.event.inputs.configure-arguments }}
135
make-arguments: ${{ github.event.inputs.make-arguments }}
136
if: needs.select.outputs.linux-x64 == 'true'
141
uses: ./.github/workflows/build-linux.yml
144
gcc-major-version: '10'
145
gcc-package-suffix: '-multilib'
146
apt-architecture: 'i386'
147
# Some multilib libraries do not have proper inter-dependencies, so we have to
148
# install their dependencies manually.
149
apt-extra-packages: 'libfreetype-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libffi-dev:i386'
150
extra-conf-options: '--with-target-bits=32 --enable-fallback-linker --enable-libffi-bundling'
151
configure-arguments: ${{ github.event.inputs.configure-arguments }}
152
make-arguments: ${{ github.event.inputs.make-arguments }}
153
if: needs.select.outputs.linux-x86 == 'true'
155
build-linux-x64-hs-nopch:
156
name: linux-x64-hs-nopch
158
uses: ./.github/workflows/build-linux.yml
161
make-target: 'hotspot'
162
debug-levels: '[ "debug" ]'
163
gcc-major-version: '10'
164
extra-conf-options: '--disable-precompiled-headers'
165
configure-arguments: ${{ github.event.inputs.configure-arguments }}
166
make-arguments: ${{ github.event.inputs.make-arguments }}
167
if: needs.select.outputs.linux-x64-variants == 'true'
169
build-linux-x64-hs-zero:
170
name: linux-x64-hs-zero
172
uses: ./.github/workflows/build-linux.yml
175
make-target: 'hotspot'
176
debug-levels: '[ "debug" ]'
177
gcc-major-version: '10'
178
extra-conf-options: '--with-jvm-variants=zero --disable-precompiled-headers'
179
configure-arguments: ${{ github.event.inputs.configure-arguments }}
180
make-arguments: ${{ github.event.inputs.make-arguments }}
181
if: needs.select.outputs.linux-x64-variants == 'true'
183
build-linux-x64-hs-minimal:
184
name: linux-x64-hs-minimal
186
uses: ./.github/workflows/build-linux.yml
189
make-target: 'hotspot'
190
debug-levels: '[ "debug" ]'
191
gcc-major-version: '10'
192
extra-conf-options: '--with-jvm-variants=minimal --disable-precompiled-headers'
193
configure-arguments: ${{ github.event.inputs.configure-arguments }}
194
make-arguments: ${{ github.event.inputs.make-arguments }}
195
if: needs.select.outputs.linux-x64-variants == 'true'
197
build-linux-x64-hs-optimized:
198
name: linux-x64-hs-optimized
200
uses: ./.github/workflows/build-linux.yml
203
make-target: 'hotspot'
204
# Technically this is not the "debug" level, but we can't inject a new matrix state for just this job
205
debug-levels: '[ "debug" ]'
206
gcc-major-version: '10'
207
extra-conf-options: '--with-debug-level=optimized --disable-precompiled-headers'
208
configure-arguments: ${{ github.event.inputs.configure-arguments }}
209
make-arguments: ${{ github.event.inputs.make-arguments }}
210
if: needs.select.outputs.linux-x64-variants == 'true'
212
build-linux-cross-compile:
213
name: linux-cross-compile
216
uses: ./.github/workflows/build-cross-compile.yml
218
gcc-major-version: '10'
219
configure-arguments: ${{ github.event.inputs.configure-arguments }}
220
make-arguments: ${{ github.event.inputs.make-arguments }}
221
if: needs.select.outputs.linux-cross-compile == 'true'
226
uses: ./.github/workflows/build-macos.yml
230
xcode-toolset-version: '14.3.1'
231
configure-arguments: ${{ github.event.inputs.configure-arguments }}
232
make-arguments: ${{ github.event.inputs.make-arguments }}
233
if: needs.select.outputs.macos-x64 == 'true'
238
uses: ./.github/workflows/build-macos.yml
240
platform: macos-aarch64
242
xcode-toolset-version: '14.3.1'
243
configure-arguments: ${{ github.event.inputs.configure-arguments }}
244
make-arguments: ${{ github.event.inputs.make-arguments }}
245
if: needs.select.outputs.macos-aarch64 == 'true'
250
uses: ./.github/workflows/build-windows.yml
252
platform: windows-x64
253
msvc-toolset-version: '14.29'
254
msvc-toolset-architecture: 'x86.x64'
255
configure-arguments: ${{ github.event.inputs.configure-arguments }}
256
make-arguments: ${{ github.event.inputs.make-arguments }}
257
if: needs.select.outputs.windows-x64 == 'true'
259
build-windows-aarch64:
260
name: windows-aarch64
262
uses: ./.github/workflows/build-windows.yml
264
platform: windows-aarch64
265
msvc-toolset-version: '14.29'
266
msvc-toolset-architecture: 'arm64'
267
make-target: 'hotspot'
268
extra-conf-options: '--openjdk-target=aarch64-unknown-cygwin'
269
configure-arguments: ${{ github.event.inputs.configure-arguments }}
270
make-arguments: ${{ github.event.inputs.make-arguments }}
271
if: needs.select.outputs.windows-aarch64 == 'true'
276
uses: ./.github/workflows/build-linux.yml
279
debug-levels: '[ "debug" ]'
280
make-target: 'docs-jdk-bundles'
281
# Make sure we never try to make full docs, since that would require a
282
# build JDK, and we do not need the additional testing of the graphs.
283
extra-conf-options: '--disable-full-docs'
284
gcc-major-version: '10'
285
configure-arguments: ${{ github.event.inputs.configure-arguments }}
286
make-arguments: ${{ github.event.inputs.make-arguments }}
287
if: needs.select.outputs.docs == 'true'
297
uses: ./.github/workflows/test.yml
300
bootjdk-platform: linux-x64
301
runs-on: ubuntu-22.04
307
uses: ./.github/workflows/test.yml
310
bootjdk-platform: linux-x64
311
runs-on: ubuntu-22.04
317
uses: ./.github/workflows/test.yml
320
bootjdk-platform: macos-x64
326
- build-macos-aarch64
327
uses: ./.github/workflows/test.yml
329
platform: macos-aarch64
330
bootjdk-platform: macos-aarch64
337
uses: ./.github/workflows/test.yml
339
platform: windows-x64
340
bootjdk-platform: windows-x64
341
runs-on: windows-2019
343
# Remove bundles so they are not misconstrued as binary distributions from the JDK project
345
name: 'Remove bundle artifacts'
346
runs-on: ubuntu-22.04
351
- build-linux-x64-hs-nopch
352
- build-linux-x64-hs-zero
353
- build-linux-x64-hs-minimal
354
- build-linux-x64-hs-optimized
355
- build-linux-cross-compile
357
- build-macos-aarch64
359
- build-windows-aarch64
366
# Hack to get hold of the api environment variables that are only defined for actions
367
- name: 'Get API configuration'
369
uses: actions/github-script@v7
371
script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }'
373
- name: 'Remove bundle artifacts'
375
# Find and remove all bundle artifacts
376
ALL_ARTIFACT_URLS="$(curl -s \
377
-H 'Accept: application/json;api-version=6.0-preview' \
378
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
379
'${{ fromJson(steps.api.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview')"
380
BUNDLE_ARTIFACT_URLS="$(echo "$ALL_ARTIFACT_URLS" | jq -r -c '.value | map(select(.name|startswith("bundles-"))) | .[].url')"
381
for url in $BUNDLE_ARTIFACT_URLS; do
384
-H 'Accept: application/json;api-version=6.0-preview' \
385
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
387
|| echo "Failed to remove bundle"