Skip to content

Release smoke test

Release smoke test #10

Workflow file for this run

name: Release smoke test
# Verifies a PUBLISHED release on Maven Central actually loads and runs on every
# supported OS/arch — one runner per native classifier. Pulls the release jars
# from Central (no source build, no submodule, no zig), so it tests exactly what
# users consume. Trigger manually and pass the version to check.
on:
workflow_dispatch:
inputs:
version:
description: Version to smoke-test. Leave blank to use the latest release on Maven Central.
required: false
default: ""
schedule:
# Weekly, Mondays 06:00 UTC. No input on scheduled runs, so the resolve job
# picks the latest release on Maven Central — catches Central / runner-image
# drift against the published release without a manual trigger.
- cron: "0 6 * * 1"
jobs:
resolve:
name: resolve version
runs-on: ubuntu-latest
permissions: {}
outputs:
version: ${{ steps.pick.outputs.version }}
steps:
- name: Resolve version (input, else latest on Maven Central)
id: pick
shell: bash
env:
INPUT_VERSION: ${{ inputs.version }}
run: |
version="$INPUT_VERSION"
if [ -z "$version" ]; then
# <release> in maven-metadata.xml is the latest non-snapshot release.
version=$(curl -fsSL --proto '=https' --tlsv1.2 https://repo1.maven.org/maven2/io/github/dfa1/zstd/zstd/maven-metadata.xml \
| grep -oE '<release>[^<]+</release>' | sed -E 's/<\/?release>//g')
fi
if [ -z "$version" ]; then
echo "could not resolve a version from Maven Central" >&2
exit 1
fi
echo "Smoke-testing version: $version"
echo "version=$version" >> "$GITHUB_OUTPUT"
smoke:
name: ${{ matrix.classifier }}${{ matrix.label && format(' ({0})', matrix.label) || '' }}
needs: resolve
# Container legs are probes (different glibc distros, musl/Alpine); they don't
# gate the workflow. The five native runner legs do.
continue-on-error: ${{ matrix.experimental || false }}
strategy:
fail-fast: false
matrix:
# distribution is per-leg for clarity and easy override. Zulu ships JDK 25
# for all targets (incl. Windows/ARM64, which Temurin does not yet) and
# matches publish.yml. Legs with `container` run the linux native inside a
# container to probe compatibility on different distributions and libcs.
include:
- { os: ubuntu-latest, classifier: linux-x86_64, distribution: zulu }
- { os: ubuntu-24.04-arm, classifier: linux-aarch64, distribution: zulu }
- { os: macos-14, classifier: osx-aarch64, distribution: zulu }
- { os: windows-latest, classifier: windows-x86_64, distribution: zulu }
- { os: windows-11-arm, classifier: windows-aarch64, distribution: zulu }
# musl (Alpine) — glibc natives on a musl libc; expected to fail until musl natives ship
- { os: ubuntu-latest, classifier: linux-x86_64, distribution: zulu, container: "amazoncorretto:25-alpine", label: musl, experimental: true }
- { os: ubuntu-24.04-arm, classifier: linux-aarch64, distribution: zulu, container: "amazoncorretto:25-alpine", label: musl, experimental: true }
# Ubuntu 22.04 (Jammy) — glibc 2.35; eclipse-temurin has no bookworm tag for JDK 25
- { os: ubuntu-latest, classifier: linux-x86_64, distribution: zulu, container: "eclipse-temurin:25-jdk-jammy", label: jammy, experimental: true }
- { os: ubuntu-24.04-arm, classifier: linux-aarch64, distribution: zulu, container: "eclipse-temurin:25-jdk-jammy", label: jammy, experimental: true }
# Red Hat UBI 10 minimal — glibc 2.34 (RHEL-like)
- { os: ubuntu-latest, classifier: linux-x86_64, distribution: zulu, container: "eclipse-temurin:25-jdk-ubi10-minimal", label: ubi, experimental: true }
- { os: ubuntu-24.04-arm, classifier: linux-aarch64, distribution: zulu, container: "eclipse-temurin:25-jdk-ubi10-minimal", label: ubi, experimental: true }
# Amazon Linux 2023 (RHEL-like) — glibc 2.34
- { os: ubuntu-latest, classifier: linux-x86_64, distribution: zulu, container: "amazoncorretto:25-al2023", label: al2023, experimental: true }
- { os: ubuntu-24.04-arm, classifier: linux-aarch64, distribution: zulu, container: "amazoncorretto:25-al2023", label: al2023, experimental: true }
runs-on: ${{ matrix.os }}
permissions:
contents: read
steps:
- name: Checkout (smoke sources only)
uses: actions/checkout@v7
- name: Set up JDK 25 (host)
uses: actions/setup-java@v5
with:
distribution: ${{ matrix.distribution }}
java-version: '25'
# --- native runner path (glibc / macOS / Windows): run via JBang on the host ---
- name: Set up JBang
if: ${{ !matrix.container }}
uses: jbangdev/setup-jbang@2b1b465a7b75f4222b81426f23a01e013aa7b95c # v0.1.1
- name: Smoke-test ${{ needs.resolve.outputs.version }} on ${{ matrix.classifier }}
if: ${{ !matrix.container }}
shell: bash
env:
VERSION: ${{ needs.resolve.outputs.version }}
run: |
jbang --java 25 \
--deps "io.github.dfa1.zstd:zstd:${VERSION},io.github.dfa1.zstd:zstd-native-${{ matrix.classifier }}:${VERSION}" \
.github/smoke/Smoke.java
# --- container probe: fetch + compile on the glibc host, run inside the target
# container, so node-based actions never run under the foreign libc/distro ---
- name: Fetch released jars and compile the smoke (container)
if: ${{ matrix.container }}
shell: bash
env:
VERSION: ${{ needs.resolve.outputs.version }}
run: |
mvn -q org.apache.maven.plugins:maven-dependency-plugin:3.8.1:copy \
-Dartifact="io.github.dfa1.zstd:zstd:${VERSION}" \
-DoutputDirectory=libs -Dmdep.stripVersion=true
mvn -q org.apache.maven.plugins:maven-dependency-plugin:3.8.1:copy \
-Dartifact="io.github.dfa1.zstd:zstd-native-${{ matrix.classifier }}:${VERSION}" \
-DoutputDirectory=libs -Dmdep.stripVersion=true
mkdir -p out
javac -cp libs/zstd.jar -d out .github/smoke/Smoke.java
- name: Smoke-test ${{ needs.resolve.outputs.version }} on ${{ matrix.classifier }} (${{ matrix.label }})
if: ${{ matrix.container }}
shell: bash
run: |
docker run --rm -v "$PWD:/w" -w /w "${{ matrix.container }}" \
java --enable-native-access=ALL-UNNAMED \
-cp "libs/zstd.jar:libs/zstd-native-${{ matrix.classifier }}.jar:out" \
Smoke