Skip to content

Language Feature: Static generic class variables #70

Language Feature: Static generic class variables

Language Feature: Static generic class variables #70

Workflow file for this run

name: CI (build & test)
on:
push:
branches: [ master ]
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Gradle build on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
permissions:
contents: read
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false
defaults:
run:
working-directory: de.peeeq.wurstscript
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Optional: still install a JDK so Gradle wrapper validation etc. have a JVM before we switch
- name: Setup Temurin JDK 25 (baseline)
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
cache: 'gradle'
# ---------- Portable JDK for Linux ----------
- name: (Linux) Install portable Temurin 25
if: runner.os == 'Linux'
shell: bash
run: |
set -euo pipefail
URL="https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25%2B36/OpenJDK25U-jdk_x64_linux_hotspot_25_36.tar.gz"
mkdir -p "$RUNNER_TEMP/temurin25"
echo "Downloading $URL"
curl -fsSL "$URL" -o "$RUNNER_TEMP/temurin25/jdk.tar.gz"
tar -xzf "$RUNNER_TEMP/temurin25/jdk.tar.gz" -C "$RUNNER_TEMP/temurin25"
PORTABLE_JAVA_HOME="$(find "$RUNNER_TEMP/temurin25" -maxdepth 1 -type d -name 'jdk-25*' | head -n1)"
echo "PORTABLE_JAVA_HOME=$PORTABLE_JAVA_HOME" >> "$GITHUB_ENV"
echo "$PORTABLE_JAVA_HOME/bin" >> "$GITHUB_PATH"
# ---------- Portable JDK for Windows ----------
- name: (Windows) Install portable Temurin 25
if: runner.os == 'Windows'
shell: powershell
run: |
$ErrorActionPreference = 'Stop'
$url = 'https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25%2B36/OpenJDK25U-jdk_x64_windows_hotspot_25_36.zip'
$root = "$env:RUNNER_TEMP\temurin25"
New-Item -ItemType Directory -Force -Path $root | Out-Null
Write-Host "Downloading $url"
Invoke-WebRequest -Uri $url -OutFile "$root\jdk.zip"
Expand-Archive -Path "$root\jdk.zip" -DestinationPath $root -Force
$dir = Get-ChildItem -Path $root -Directory | Where-Object { $_.Name -like 'jdk-25*' } | Select-Object -First 1
if (-not $dir) { throw "Extracted JDK directory not found under $root" }
$pjh = $dir.FullName
"PORTABLE_JAVA_HOME=$pjh" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
"$pjh\bin" | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8
# Pin Gradle toolchain to the active (portable) JAVA_HOME
- name: Pin Gradle toolchain to portable JDK
shell: bash
run: |
ACTIVE_JAVA_HOME="${PORTABLE_JAVA_HOME:-$JAVA_HOME}"
echo "JAVA_HOME=${ACTIVE_JAVA_HOME}" >> "$GITHUB_ENV"
echo "${ACTIVE_JAVA_HOME}/bin" >> "$GITHUB_PATH"
# write gradle.properties in repo root (defaults.working-directory is already the module)
echo "org.gradle.java.installations.paths=${ACTIVE_JAVA_HOME}" >> gradle.properties
echo "org.gradle.java.installations.auto-detect=false" >> gradle.properties
# Cross-shell sanity print (bash works on both runners)
- name: Show Java & jlink
shell: bash
run: |
echo "JAVA_HOME=$JAVA_HOME"
"$JAVA_HOME/bin/java" -version
"$JAVA_HOME/bin/jlink" --version
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Setup Gradle (cache)
uses: gradle/actions/setup-gradle@v4
# ---------- FAIL FAST: build slim runtime + package BEFORE tests ----------
- name: Package slim runtime (fail fast)
shell: bash
run: ./gradlew checksumSlimCompilerDist --no-daemon --stacktrace
# Only run tests if packaging passed
- name: Run tests
shell: bash
run: ./gradlew test --no-daemon --stacktrace
- name: Upload packaged artifact (per-OS)
uses: actions/upload-artifact@v4
with:
name: wurst-compiler-${{ matrix.os }}
path: |
de.peeeq.wurstscript/build/releases/*.zip
de.peeeq.wurstscript/build/releases/*.tar.gz
de.peeeq.wurstscript/build/releases/*.sha256
if-no-files-found: error
retention-days: 7