-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (122 loc) · 6.7 KB
/
Copy pathrelease-smoke.yml
File metadata and controls
131 lines (122 loc) · 6.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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