Skip to content

Commit 8313768

Browse files
gdamspull[bot]
authored andcommitted
8282944: GHA: Add Alpine Linux x86_64 pre-integration check
Reviewed-by: ihse
1 parent 64d1675 commit 8313768

File tree

4 files changed

+153
-3
lines changed

4 files changed

+153
-3
lines changed

.github/actions/config/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ runs:
4141
id: read-config
4242
run: |
4343
# Extract value from configuration file
44-
value="$(grep -h ${{ inputs.var }}= make/conf/github-actions.conf | cut -d '=' -f 2-)"
44+
value="$(grep -h '^${{ inputs.var }}'= make/conf/github-actions.conf | cut -d '=' -f 2-)"
4545
echo "value=$value" >> $GITHUB_OUTPUT
4646
shell: bash
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
#
2+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
3+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
#
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.
10+
#
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).
16+
#
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.
20+
#
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
23+
# questions.
24+
#
25+
26+
name: 'Build (alpine-linux)'
27+
28+
on:
29+
workflow_call:
30+
inputs:
31+
platform:
32+
required: true
33+
type: string
34+
extra-conf-options:
35+
required: false
36+
type: string
37+
make-target:
38+
required: false
39+
type: string
40+
default: 'product-bundles test-bundles'
41+
debug-levels:
42+
required: false
43+
type: string
44+
default: '[ "debug", "release" ]'
45+
apk-extra-packages:
46+
required: false
47+
type: string
48+
configure-arguments:
49+
required: false
50+
type: string
51+
make-arguments:
52+
required: false
53+
type: string
54+
55+
jobs:
56+
build-linux:
57+
name: build
58+
runs-on: ubuntu-22.04
59+
container:
60+
image: alpine:3.20
61+
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
debug-level: ${{ fromJSON(inputs.debug-levels) }}
66+
include:
67+
- debug-level: debug
68+
flags: --with-debug-level=fastdebug
69+
suffix: -debug+
70+
71+
steps:
72+
- name: 'Checkout the JDK source'
73+
uses: actions/checkout@v4
74+
75+
- name: 'Install toolchain and dependencies'
76+
run: |
77+
apk update
78+
apk add alpine-sdk alsa-lib-dev autoconf bash cups-dev cups-libs fontconfig-dev freetype-dev grep libx11-dev libxext-dev libxrandr-dev libxrender-dev libxt-dev libxtst-dev linux-headers wget zip ${{ inputs.apk-extra-packages }}
79+
80+
- name: 'Get the BootJDK'
81+
id: bootjdk
82+
uses: ./.github/actions/get-bootjdk
83+
with:
84+
platform: alpine-linux-x64
85+
86+
- name: 'Configure'
87+
run: >
88+
bash configure
89+
--with-conf-name=${{ inputs.platform }}
90+
${{ matrix.flags }}
91+
--with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
92+
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
93+
--with-zlib=system
94+
--with-jmod-compress=zip-1
95+
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
96+
echo "Dumping config.log:" &&
97+
cat config.log &&
98+
exit 1)
99+
100+
- name: 'Build'
101+
id: build
102+
uses: ./.github/actions/do-build
103+
with:
104+
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
105+
platform: ${{ inputs.platform }}
106+
debug-suffix: '${{ matrix.suffix }}'
107+
108+
- name: 'Upload bundles'
109+
uses: ./.github/actions/upload-bundles
110+
with:
111+
platform: ${{ inputs.platform }}
112+
debug-suffix: '${{ matrix.suffix }}'

.github/workflows/main.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ on:
3636
platforms:
3737
description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")'
3838
required: true
39-
default: 'linux-x64, linux-x86-hs, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
39+
default: 'linux-x64, linux-x86-hs, linux-x64-variants, linux-cross-compile, alpine-linux-x64, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
4040
configure-arguments:
4141
description: 'Additional configure arguments'
4242
required: false
@@ -57,11 +57,15 @@ jobs:
5757
select:
5858
name: 'Select platforms'
5959
runs-on: ubuntu-22.04
60+
env:
61+
# List of platforms to exclude by default
62+
EXCLUDED_PLATFORMS: 'alpine-linux-x64'
6063
outputs:
6164
linux-x64: ${{ steps.include.outputs.linux-x64 }}
6265
linux-x86-hs: ${{ steps.include.outputs.linux-x86-hs }}
6366
linux-x64-variants: ${{ steps.include.outputs.linux-x64-variants }}
6467
linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }}
68+
alpine-linux-x64: ${{ steps.include.outputs.alpine-linux-x64 }}
6569
macos-x64: ${{ steps.include.outputs.macos-x64 }}
6670
macos-aarch64: ${{ steps.include.outputs.macos-aarch64 }}
6771
windows-x64: ${{ steps.include.outputs.windows-x64 }}
@@ -78,6 +82,10 @@ jobs:
7882
# Returns 'true' if the input platform list matches any of the platform monikers given as argument,
7983
# 'false' otherwise.
8084
# arg $1: platform name or names to look for
85+
86+
# Convert EXCLUDED_PLATFORMS from a comma-separated string to an array
87+
IFS=',' read -r -a excluded_array <<< "$EXCLUDED_PLATFORMS"
88+
8189
function check_platform() {
8290
if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
8391
input='${{ github.event.inputs.platforms }}'
@@ -94,7 +102,13 @@ jobs:
94102
95103
normalized_input="$(echo ,$input, | tr -d ' ')"
96104
if [[ "$normalized_input" == ",," ]]; then
97-
# For an empty input, assume all platforms should run
105+
# For an empty input, assume all platforms should run, except those in the EXCLUDED_PLATFORMS list
106+
for excluded in "${excluded_array[@]}"; do
107+
if [[ "$1" == "$excluded" ]]; then
108+
echo 'false'
109+
return
110+
fi
111+
done
98112
echo 'true'
99113
return
100114
else
@@ -105,6 +119,14 @@ jobs:
105119
return
106120
fi
107121
done
122+
123+
# If not explicitly included, check against the EXCLUDED_PLATFORMS list
124+
for excluded in "${excluded_array[@]}"; do
125+
if [[ "$1" == "$excluded" ]]; then
126+
echo 'false'
127+
return
128+
fi
129+
done
108130
fi
109131
110132
echo 'false'
@@ -114,6 +136,7 @@ jobs:
114136
echo "linux-x86-hs=$(check_platform linux-x86-hs linux x86)" >> $GITHUB_OUTPUT
115137
echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
116138
echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
139+
echo "alpine-linux-x64=$(check_platform alpine-linux-x64 alpine-linux x64)" >> $GITHUB_OUTPUT
117140
echo "macos-x64=$(check_platform macos-x64 macos x64)" >> $GITHUB_OUTPUT
118141
echo "macos-aarch64=$(check_platform macos-aarch64 macos aarch64)" >> $GITHUB_OUTPUT
119142
echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
@@ -221,6 +244,16 @@ jobs:
221244
make-arguments: ${{ github.event.inputs.make-arguments }}
222245
if: needs.select.outputs.linux-cross-compile == 'true'
223246

247+
build-alpine-linux-x64:
248+
name: alpine-linux-x64
249+
needs: select
250+
uses: ./.github/workflows/build-alpine-linux.yml
251+
with:
252+
platform: alpine-linux-x64
253+
configure-arguments: ${{ github.event.inputs.configure-arguments }}
254+
make-arguments: ${{ github.event.inputs.make-arguments }}
255+
if: needs.select.outputs.alpine-linux-x64 == 'true'
256+
224257
build-macos-x64:
225258
name: macos-x64
226259
needs: select
@@ -344,6 +377,7 @@ jobs:
344377
- build-linux-x64-hs-minimal
345378
- build-linux-x64-hs-optimized
346379
- build-linux-cross-compile
380+
- build-alpine-linux-x64
347381
- build-macos-x64
348382
- build-macos-aarch64
349383
- build-windows-x64

make/conf/github-actions.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ LINUX_X64_BOOT_JDK_EXT=tar.gz
3232
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22.0.2/c9ecb94cd31b495da20a27d4581645e8/9/GPL/openjdk-22.0.2_linux-x64_bin.tar.gz
3333
LINUX_X64_BOOT_JDK_SHA256=41536f115668308ecf4eba92aaf6acaeb0936225828b741efd83b6173ba82963
3434

35+
ALPINE_LINUX_X64_BOOT_JDK_EXT=tar.gz
36+
ALPINE_LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.2%2B9/OpenJDK22U-jdk_x64_alpine-linux_hotspot_22.0.2_9.tar.gz
37+
ALPINE_LINUX_X64_BOOT_JDK_SHA256=49f73414824b1a7c268a611225fa4d7ce5e25600201e0f1cd59f94d1040b5264
38+
3539
MACOS_AARCH64_BOOT_JDK_EXT=tar.gz
3640
MACOS_AARCH64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22.0.2/c9ecb94cd31b495da20a27d4581645e8/9/GPL/openjdk-22.0.2_macos-aarch64_bin.tar.gz
3741
MACOS_AARCH64_BOOT_JDK_SHA256=3dab98730234e1a87aec14bcb8171d2cae101e96ff4eed1dab96abbb08e843fd

0 commit comments

Comments
 (0)