Skip to content

Commit f287dc7

Browse files
committed
Update build.yml
1 parent c010e4f commit f287dc7

1 file changed

Lines changed: 5 additions & 28 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -32,59 +32,37 @@ jobs:
3232
with:
3333
fetch-depth: 0
3434

35-
# Optional: still install a JDK so Gradle wrapper validation etc. have a JVM before we switch
36-
- name: Setup Temurin JDK 25 (baseline)
35+
- name: Setup Temurin JDK 25
3736
uses: actions/setup-java@v4
3837
with:
3938
distribution: temurin
4039
java-version: '25'
4140
cache: 'gradle'
4241

43-
# ---------- Portable JDK for Linux ----------
42+
# Linux only: use a portable, pristine Temurin 25 for jlink
4443
- name: (Linux) Install portable Temurin 25
4544
if: runner.os == 'Linux'
4645
shell: bash
4746
run: |
4847
set -euo pipefail
4948
URL="https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25%2B36/OpenJDK25U-jdk_x64_linux_hotspot_25_36.tar.gz"
5049
mkdir -p "$RUNNER_TEMP/temurin25"
51-
echo "Downloading $URL"
5250
curl -fsSL "$URL" -o "$RUNNER_TEMP/temurin25/jdk.tar.gz"
5351
tar -xzf "$RUNNER_TEMP/temurin25/jdk.tar.gz" -C "$RUNNER_TEMP/temurin25"
5452
PORTABLE_JAVA_HOME="$(find "$RUNNER_TEMP/temurin25" -maxdepth 1 -type d -name 'jdk-25*' | head -n1)"
5553
echo "PORTABLE_JAVA_HOME=$PORTABLE_JAVA_HOME" >> "$GITHUB_ENV"
5654
echo "$PORTABLE_JAVA_HOME/bin" >> "$GITHUB_PATH"
5755
58-
# ---------- Portable JDK for Windows ----------
59-
- name: (Windows) Install portable Temurin 25
60-
if: runner.os == 'Windows'
61-
shell: powershell
62-
run: |
63-
$ErrorActionPreference = 'Stop'
64-
$url = 'https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25%2B36/OpenJDK25U-jdk_x64_windows_hotspot_25_36.zip'
65-
$root = "$env:RUNNER_TEMP\temurin25"
66-
New-Item -ItemType Directory -Force -Path $root | Out-Null
67-
Write-Host "Downloading $url"
68-
Invoke-WebRequest -Uri $url -OutFile "$root\jdk.zip"
69-
Expand-Archive -Path "$root\jdk.zip" -DestinationPath $root -Force
70-
$dir = Get-ChildItem -Path $root -Directory | Where-Object { $_.Name -like 'jdk-25*' } | Select-Object -First 1
71-
if (-not $dir) { throw "Extracted JDK directory not found under $root" }
72-
$pjh = $dir.FullName
73-
"PORTABLE_JAVA_HOME=$pjh" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
74-
"$pjh\bin" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
75-
76-
# Pin Gradle toolchain to the active (portable) JAVA_HOME
77-
- name: Pin Gradle toolchain to portable JDK
56+
# Pin Gradle toolchain to the active JDK (portable on Linux, setup-java on Windows)
57+
- name: Pin Gradle toolchain
7858
shell: bash
7959
run: |
8060
ACTIVE_JAVA_HOME="${PORTABLE_JAVA_HOME:-$JAVA_HOME}"
8161
echo "JAVA_HOME=${ACTIVE_JAVA_HOME}" >> "$GITHUB_ENV"
8262
echo "${ACTIVE_JAVA_HOME}/bin" >> "$GITHUB_PATH"
83-
# write gradle.properties in repo root (defaults.working-directory is already the module)
8463
echo "org.gradle.java.installations.paths=${ACTIVE_JAVA_HOME}" >> gradle.properties
8564
echo "org.gradle.java.installations.auto-detect=false" >> gradle.properties
8665
87-
# Cross-shell sanity print (bash works on both runners)
8866
- name: Show Java & jlink
8967
shell: bash
9068
run: |
@@ -98,12 +76,11 @@ jobs:
9876
- name: Setup Gradle (cache)
9977
uses: gradle/actions/setup-gradle@v4
10078

101-
# ---------- FAIL FAST: build slim runtime + package BEFORE tests ----------
79+
# ---- FAIL FAST: package first (so jlink issues show immediately) ----
10280
- name: Package slim runtime (fail fast)
10381
shell: bash
10482
run: ./gradlew checksumSlimCompilerDist --no-daemon --stacktrace
10583

106-
# Only run tests if packaging passed
10784
- name: Run tests
10885
shell: bash
10986
run: ./gradlew test --no-daemon --stacktrace

0 commit comments

Comments
 (0)