-
Notifications
You must be signed in to change notification settings - Fork 1
161 lines (143 loc) · 6.31 KB
/
Copy pathci.yml
File metadata and controls
161 lines (143 loc) · 6.31 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
name: test / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
# ./gradlew (the POSIX launcher script) needs bash; windows-latest
# defaults to pwsh, but Git Bash ships on the runner. Linux/macOS are
# bash already, so this is a no-op there.
shell: bash
strategy:
fail-fast: false
matrix:
# Linux x64 + macOS arm64 + Windows x64 (all supported targets). macOS is
# not redundant: the POSIX shm overlay (FfmShm) has an explicit Darwin
# branch — different shm_open(2) open flags than Linux — that the ubuntu
# lane never exercises. Windows has no POSIX shm, so its lane proves the
# library degrades to the pure-JVM pipe/HTTP path (shm unadvertised); the
# FFM-overlay lanes are skipped there (see `if:` guards below).
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
# Install three runtimes and hand Gradle their exact paths. The build
# toolchain is JDK 25 (it compiles the release-21 baseline AND the
# release-22 multi-release shared-memory overlay); the 22 and 21 installs
# back the runtime-retargeting test lanes below. Passing
# `installations.paths` (vs. the JAVA_HOME_*_<arch> env vars) keeps this
# architecture-independent — those env vars are _X64 on the Linux runner
# but _ARM64 on the macOS runner. Listing 21 last makes it JAVA_HOME, so
# the Gradle launcher itself runs on 21 while the 25 toolchain compiles.
- name: Set up JDK 25
id: jdk25
uses: actions/setup-java@v4
with: { distribution: temurin, java-version: '25' }
- name: Set up JDK 22
id: jdk22
uses: actions/setup-java@v4
with: { distribution: temurin, java-version: '22' }
- name: Set up JDK 21
id: jdk21
uses: actions/setup-java@v4
with: { distribution: temurin, java-version: '21' }
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: gradle-${{ runner.os }}-
- name: Toolchain paths
id: jdks
run: echo "paths=${{ steps.jdk25.outputs.path }},${{ steps.jdk22.outputs.path }},${{ steps.jdk21.outputs.path }}" >> "$GITHUB_OUTPUT"
- name: Test on JDK 25 (core)
run: >-
./gradlew --no-daemon
-Porg.gradle.java.installations.paths=${{ steps.jdks.outputs.paths }}
:vgirpc:test
# FFM shared-memory overlay: POSIX-only, so skip on Windows (no shm_open —
# ShmFactory.available() is false there and the worker uses the pipe path).
- name: Test on JDK 25 (FFM shared-memory overlay)
if: runner.os != 'Windows'
run: >-
./gradlew --no-daemon
-Porg.gradle.java.installations.paths=${{ steps.jdks.outputs.paths }}
:vgirpc:java22Test
- name: Test on JDK 22 (FFM overlay on a real 22 runtime)
if: runner.os != 'Windows'
run: >-
./gradlew --no-daemon --rerun-tasks
-Porg.gradle.java.installations.paths=${{ steps.jdks.outputs.paths }}
-PtestJdk=22 :vgirpc:java22Test
- name: Test on JDK 21 (core; shm disabled, pipe fallback)
run: >-
./gradlew --no-daemon --rerun-tasks
-Porg.gradle.java.installations.paths=${{ steps.jdks.outputs.paths }}
-PtestJdk=21 :vgirpc:test
# Python-driven conformance suite: a Python driver (the vgi_rpc reference)
# spawns the Java worker and asserts byte-for-byte wire compatibility. Fanned
# out across transport groups so the lanes run in parallel and failures
# isolate by mode. All lanes run on JDK 25 (the build toolchain + worker
# runtime); the shm side-channel is exercised explicitly via the
# "subprocess_shm" transport — where the Python client owns a POSIX segment
# and batches ride shared memory — rather than implicitly by runtime JDK. The
# Java-21 baseline runtime is covered by the JUnit `-PtestJdk=21` lane.
# * launcher -> pipe/subprocess/unix, inline (no shm) wire
# * launcher+shm -> subprocess + POSIX shared-memory side-channel
# * http -> HTTP transport
conformance:
name: conformance / ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: launcher (pipe/unix, no shm)
transports: pipe,subprocess,unix
- name: launcher + shm
transports: subprocess_shm
- name: http
transports: http,http_externalize_always
steps:
- uses: actions/checkout@v4
- name: Set up JDK 25
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: gradle-${{ runner.os }}-
# The Java worker tracks the *unreleased* Python reference (0.19.0+ on
# main), which is ahead of PyPI's latest — so install vgi_rpc from source
# off the default branch rather than `pip install vgi-rpc`.
- name: Clone vgi-rpc-python reference
run: git clone --depth 1 https://github.com/Query-farm/vgi-rpc-python.git "$RUNNER_TEMP/vgi-rpc-python"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install "${RUNNER_TEMP}/vgi-rpc-python[http,cli,external,conformance,oauth,mtls]" pytest pytest-timeout
- name: Build conformance worker
run: ./gradlew --no-daemon :conformance-worker:installDist
- name: Run conformance suite (${{ matrix.transports }})
env:
CONFORMANCE_TRANSPORTS: ${{ matrix.transports }}
run: python -m pytest tests/test_java_conformance.py -p no:cacheprovider -q --timeout=120