-
Notifications
You must be signed in to change notification settings - Fork 3
324 lines (275 loc) · 11 KB
/
Copy pathci.yml
File metadata and controls
324 lines (275 loc) · 11 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
name: CI
on:
push:
branches:
- main
- develop
pull_request:
# Run CI for any incoming PR regardless of the base branch so
# feature branches targeting `develop` (e.g. v1.7 prep) also
# exercise the full pipeline.
workflow_dispatch:
schedule:
- cron: '0 5 * * 1'
permissions:
contents: read
jobs:
architecture-and-documentation-guards:
name: Architecture and Documentation Guards
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
env:
JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Temurin JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
cache: maven
- name: Run guards
run: |
./mvnw -B -ntp clean \
"-Dtest=EnginePdfBoundaryTest,CanonicalTemplateComposerPdfBoundaryTest,PdfRenderInterfaceGuardTest,PdfRenderingSystemECSDispatchTest,DocumentationCoverageTest,DocumentationExamplesTest,CanonicalSurfaceGuardTest,TemplateComposeApiTest,VersionConsistencyGuardTest" \
test
build-and-test:
name: Build and run tests (JDK ${{ matrix.java }})
if: github.event_name != 'schedule'
needs: architecture-and-documentation-guards
runs-on: ubuntu-latest
strategy:
# Don't cancel sibling matrix jobs on the first failure — a
# regression on one JDK is informative even if other JDKs are
# still running.
fail-fast: false
matrix:
# 17 = baseline, 21 = previous baseline still supported,
# 25 = current LTS, validates the byte-buddy / Mockito 5.23
# bumps that #10 motivated.
java: ['17', '21', '25']
env:
JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Temurin JDK ${{ matrix.java }}
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: maven
- name: Build and run tests
run: ./mvnw -B -ntp clean verify
- name: Generate Javadoc
# Run only on the baseline JDK — Javadoc output is identical
# across JVMs and one pass is enough to catch broken @link
# references.
if: matrix.java == '17'
run: ./mvnw -B -ntp javadoc:javadoc
examples-generation:
name: Examples Generation Smoke Test
if: github.event_name != 'schedule'
needs: build-and-test
runs-on: ubuntu-latest
env:
JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Temurin JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
cache: maven
- name: Install graph-compose-fonts (consumed by the examples / benchmarks modules)
# The engine itself does not depend on the fonts artifact, but the
# examples and benchmarks modules render with the bundled families, so
# install graph-compose-fonts into the local repo before building them.
run: ./mvnw -B -ntp -f fonts/pom.xml -DskipTests install
- name: Install root artifact
run: ./mvnw -B -ntp -DskipTests install -pl .
- name: Compile examples module
run: ./mvnw -B -ntp -f examples/pom.xml clean compile
- name: Run GenerateAllExamples
run: |
./mvnw -B -ntp -f examples/pom.xml exec:java \
"-Dexec.mainClass=com.demcha.examples.GenerateAllExamples"
- name: Upload generated PDFs
if: always()
uses: actions/upload-artifact@v7
with:
name: examples-pdfs-${{ github.run_id }}
path: examples/target/generated-pdfs/**
if-no-files-found: error
no-poi-suite:
name: Test suite without poi-ooxml (optional-deps regression)
if: github.event_name == 'pull_request'
needs: architecture-and-documentation-guards
runs-on: ubuntu-latest
env:
JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Temurin JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
cache: maven
- name: Run suite under -P no-poi
# poi-ooxml is declared <optional>true</optional>; this job
# validates that callers who don't render DOCX still get a
# green suite without the POI footprint. Tests that require
# poi (DocxSemanticBackend output) carry
# @DisabledIfSystemProperty(named = "no.poi", matches = "true")
# and skip cleanly. See Track I1 in the readiness taskboard.
run: ./mvnw -B -ntp test -pl . -P no-poi
binary-compat:
name: Binary Compatibility (japicmp vs pom baseline)
if: github.event_name == 'pull_request'
needs: architecture-and-documentation-guards
runs-on: ubuntu-latest
env:
JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Temurin JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
cache: maven
- name: Compare public API against baseline
# The `japicmp` profile resolves the baseline release pinned
# by the `japicmp.baseline` property in pom.xml (via the
# profile-local JitPack repository) and diffs it against the
# freshly-built artifact. Fails the job on any binary-
# incompatible modification to the public surface. Source-
# incompatible changes are reported only (phased policy).
# See CHANGELOG v1.6.6 "Build" notes for the policy rationale.
run: ./mvnw -B -ntp -DskipTests -P japicmp verify -pl .
- name: Upload japicmp report
if: always()
uses: actions/upload-artifact@v7
with:
name: japicmp-report-${{ github.run_id }}
path: target/japicmp/**
if-no-files-found: ignore
perf-smoke:
name: Performance Smoke Check
if: github.event_name == 'pull_request'
needs: architecture-and-documentation-guards
runs-on: ubuntu-latest
env:
JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Temurin JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
cache: maven
- name: Install graph-compose-fonts (consumed by the examples / benchmarks modules)
# The engine itself does not depend on the fonts artifact, but the
# examples and benchmarks modules render with the bundled families, so
# install graph-compose-fonts into the local repo before building them.
run: ./mvnw -B -ntp -f fonts/pom.xml -DskipTests install
- name: Install root artifact
run: ./mvnw -B -ntp -DskipTests install -pl .
- name: Compile benchmarks module
run: ./mvnw -B -ntp -f benchmarks/pom.xml clean compile
- name: Run deterministic benchmark gates
# Fast, machine-independent unit/gate tests (image-cache reuse,
# render-operator coalescing, scenario/threshold coverage, diff tooling).
# Catches structural regressions the timing smoke run cannot.
run: ./mvnw -B -ntp -f benchmarks/pom.xml test
- name: Run coarse performance smoke benchmark
run: |
./mvnw -B -ntp -f benchmarks/pom.xml -DskipTests \
exec:java \
"-Dexec.mainClass=com.demcha.compose.CurrentSpeedBenchmark" \
"-Dgraphcompose.benchmark.profile=smoke"
- name: Upload smoke benchmark artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: benchmark-smoke-${{ github.run_id }}
path: benchmarks/target/benchmarks/current-speed/**
if-no-files-found: ignore
- name: Upload benchmark gate reports
if: always()
uses: actions/upload-artifact@v7
with:
name: benchmark-gate-reports-${{ github.run_id }}
path: benchmarks/target/surefire-reports/**
if-no-files-found: ignore
benchmark-diff:
name: Weekly Benchmark Diff
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
env:
JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Temurin JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
cache: maven
- name: Restore benchmark history cache
uses: actions/cache@v5
with:
path: benchmarks/target/benchmarks/current-speed
key: benchmark-current-speed-${{ github.ref_name }}-${{ github.run_id }}
restore-keys: |
benchmark-current-speed-${{ github.ref_name }}-
benchmark-current-speed-
- name: Install graph-compose-fonts (consumed by the examples / benchmarks modules)
# The engine itself does not depend on the fonts artifact, but the
# examples and benchmarks modules render with the bundled families, so
# install graph-compose-fonts into the local repo before building them.
run: ./mvnw -B -ntp -f fonts/pom.xml -DskipTests install
- name: Install root artifact
run: ./mvnw -B -ntp -DskipTests install -pl .
- name: Compile benchmarks module
run: ./mvnw -B -ntp -f benchmarks/pom.xml clean compile
- name: Run full benchmark suite
run: |
./mvnw -B -ntp -f benchmarks/pom.xml -DskipTests \
exec:java \
"-Dexec.mainClass=com.demcha.compose.CurrentSpeedBenchmark" \
"-Dgraphcompose.benchmark.profile=full" \
"-Dgraphcompose.benchmark.enforceGate=false"
- name: Count available benchmark runs
id: benchmark-runs
run: |
count=0
if [ -d benchmarks/target/benchmarks/current-speed ]; then
count=$(find benchmarks/target/benchmarks/current-speed -maxdepth 1 -name 'run-*.json' | wc -l | tr -d ' ')
fi
echo "count=$count" >> "$GITHUB_OUTPUT"
- name: Diff newest benchmark reports
if: steps.benchmark-runs.outputs.count != '0' && steps.benchmark-runs.outputs.count != '1'
run: |
./mvnw -B -ntp -f benchmarks/pom.xml -DskipTests \
exec:java \
"-Dexec.mainClass=com.demcha.compose.BenchmarkDiffTool" \
"-Dexec.args=current-speed"
- name: Upload benchmark artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: benchmark-full-${{ github.run_id }}
path: |
benchmarks/target/benchmarks/current-speed/**
benchmarks/target/benchmarks/diffs/current-speed/**
if-no-files-found: ignore