Repository navigation
588 lines (566 loc) · 28.6 KB
/
Copy pathci.yml
File metadata and controls
588 lines (566 loc) · 28.6 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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: ci
run-name: >-
${{ github.event_name == 'workflow_dispatch' && inputs.release_candidate
&& format('Release candidate {0}', inputs.release_dispatch_id)
|| github.workflow }}
on:
workflow_dispatch:
inputs:
release_candidate:
description: Build unsigned release artifacts with Javadocs and legal resources
type: boolean
default: false
release_dispatch_id:
description: Unique release workflow correlation identifier
type: string
required: false
default: ''
# Required checks must report a result even for documentation-only PRs.
pull_request:
push:
branches:
- master
paths-ignore:
- '*.md'
- '**/README*.md'
- 'docs/**'
- '**/docs/**'
- '.github/ISSUE_TEMPLATE/**'
- '.github/PULL_REQUEST_TEMPLATE.md'
concurrency:
# Give every non-PR run its own group, including runs still waiting for a runner.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
agent_gateway_migrations:
needs: changes
if: github.repository == 'apache/shenyu' && needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Agent Gateway upgrade and schema consistency
run: |
python3 .github/scripts/check-agent-gateway-migrations.py
python3 .github/scripts/test-agent-gateway-migrations.py
changes:
if: github.repository == 'apache/shenyu'
runs-on: ubuntu-latest
outputs:
code: ${{ steps.modules.outputs.has_code_changes }}
code_files: ${{ steps.filter.outputs.code_files }}
rat_required: ${{ steps.filter.outputs.code }}
modules: ${{ steps.modules.outputs.modules }}
full_build_required: ${{ steps.modules.outputs.full_build_required }}
steps:
- uses: actions/checkout@v4
- name: Test workflow scope and example image selection
run: |
node --test .github/scripts/test-ci-workflows.mjs
node --test .github/scripts/issue-spec-policy-test.mjs
python3 -B .github/scripts/test-resolve-example-projects.py
python3 -B .github/scripts/test-actions-timings.py
python3 -B .github/scripts/test-restore-shenyu-local-repo.py
python3 -B .github/scripts/test-check-release-artifacts.py
- name: Test CI case resolver
run: bash .github/scripts/resolve-test-case-matrix-test.sh
- name: Test HTTP pool snapshot source provenance
run: python3 script/performance/http-pool/test_snapshot.py
- name: Test HTTP pool benchmark report integrity
run: python3 script/performance/http-pool/test_report.py
- name: Test HTTP pool Java argument files
run: python3 script/performance/http-pool/test_runner.py
- name: Test Maven transfer retries
run: bash .github/scripts/maven-with-retry-test.sh
- name: Test storage Compose healthchecks
run: bash shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-storage/compose/script/compose-script-test.sh
- name: Test E2E artifact reruns
run: node --test .github/scripts/retest-test.mjs
- uses: ./actions/paths-filter
id: filter
with:
list-files: "json"
predicate-quantifier: every
filters: |
code:
- '**'
- '!.asf.yaml'
- '!.gitignore'
- '!.licenserc.yaml'
- '!LICENSE'
- '!**/LICENSE'
- '!shenyu-*/**/LICENSE'
- '!shenyu-*/**/release-docs/LICENSE'
- '!NOTICE'
- '!**/NOTICE'
- '!shenyu-*/**/NOTICE'
- '!shenyu-*/**/release-docs/NOTICE'
- '!.github/ISSUE_TEMPLATE/**'
- '!*.md'
- '!**/README*.md'
- '!docs/**'
- '!**/docs/**'
- '!.github/PULL_REQUEST_TEMPLATE.md'
- name: Resolve changed Maven modules
id: modules
if: steps.filter.outputs.code == 'true' || github.event_name == 'workflow_dispatch'
env:
CHANGED_FILES_JSON: ${{ github.event_name == 'workflow_dispatch' && '["pom.xml"]' || steps.filter.outputs.code_files }}
run: bash .github/scripts/resolve-ci-modules.sh
- name: Test GHCR publish routing
run: bash .github/scripts/resolve-ghcr-publish-test.sh
registry_dependencies:
needs: changes
runs-on: ubuntu-latest
if: github.repository == 'apache/shenyu' && needs.changes.outputs.code == 'true'
steps:
- uses: actions/checkout@v4
- uses: ./actions/setup-java-with-retry
with:
java-version: "17"
distribution: "temurin"
cache: maven
- name: Ensure Maven wrapper JAR
run: bash .github/scripts/ensure-maven-wrapper.sh
- name: Replay registration contract and check resolved client boundaries
run: |
python3 .github/scripts/test-client-boundary.py
python3 .github/scripts/check-client-boundary.py
bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp -pl shenyu-admin,shenyu-spring-boot-starter/shenyu-spring-boot-starter-client/shenyu-spring-boot-starter-client-beat -am package dependency:tree \
-Dtest=RegistrationProtocolCompatibilityTest,ZookeeperClientDiscoveryIntegrationTest,HeartbeatListenerConfigurationTest \
-Dsurefire.failIfNoSpecifiedTests=false -DskipRemoteResources=true -Djacoco.skip=true -Dmaven.javadoc.skip=true \
-Dscope=test -DoutputType=tgf -DoutputFile=target/client-boundary.tgf
python3 .github/scripts/check-client-boundary.py --trees
- name: Check resolved registry dependency boundaries
run: |
python3 .github/scripts/test-registry-dependencies.py
REGISTRY_MODULES="$(python3 .github/scripts/check-registry-dependencies.py --modules)"
bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp -pl "$REGISTRY_MODULES" -am package dependency:tree \
-DskipTests -DskipRemoteResources=true -Djacoco.skip=true -Dmaven.javadoc.skip=true \
-Dscope=runtime -DoutputType=tgf -DoutputFile=target/registry-dependencies.tgf
python3 .github/scripts/check-registry-dependencies.py
rat_check:
needs: changes
runs-on: ubuntu-latest
if: github.repository == 'apache/shenyu' && (needs.changes.outputs.rat_required == 'true' || github.event_name == 'workflow_dispatch')
steps:
- uses: actions/checkout@v4
- uses: ./actions/setup-java-with-retry
with:
java-version: "17"
distribution: "temurin"
- name: Ensure Maven wrapper JAR
run: bash .github/scripts/ensure-maven-wrapper.sh
- name: Run Apache RAT check
run: ./mvnw -B -ntp apache-rat:check
plugin_contract:
needs: [changes]
runs-on: ubuntu-latest
timeout-minutes: 20
if: github.repository == 'apache/shenyu' && needs.changes.outputs.code == 'true'
steps:
- uses: actions/checkout@v4
- uses: ./actions/setup-java-with-retry
with:
java-version: "17"
distribution: "temurin"
cache: maven
- name: Ensure Maven wrapper JAR
run: bash .github/scripts/ensure-maven-wrapper.sh
- name: Install the packaged plugin contract kit
run: |
bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp -pl shenyu-web -am install \
-DskipTests -DskipRemoteResources=true -Djacoco.skip=true -Dmaven.javadoc.skip=true
- name: Test the external plugin contract consumer
run: |
bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp \
-f shenyu-examples/shenyu-examples-plugin-contract/pom.xml \
test org.apache.rat:apache-rat-plugin:0.15:check -DfailIfNoTests=true -Djacoco.skip=true
pr_build:
needs: changes
runs-on: ubuntu-latest
if: github.repository == 'apache/shenyu' && github.event_name == 'pull_request' && needs.changes.outputs.code == 'true' && needs.changes.outputs.full_build_required != 'true'
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./actions/setup-java-with-retry
with:
java-version: "17"
distribution: "temurin"
cache: maven
- name: Ensure Maven wrapper JAR
run: bash .github/scripts/ensure-maven-wrapper.sh
- name: Build with Maven
shell: bash
env:
MODULES: ${{ needs.changes.outputs.modules }}
run: |
module_args=()
if [[ -n "$MODULES" ]]; then
module_args=(-pl "$MODULES" -am)
fi
exec bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp -T 1C "${module_args[@]}" test \
-Prelease -DskipRemoteResources=true -Djacoco.skip=true
build_local_repo:
needs: changes
runs-on: ubuntu-latest
if: github.repository == 'apache/shenyu' && (github.event_name != 'pull_request' || needs.changes.outputs.full_build_required == 'true') && needs.changes.outputs.code == 'true'
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./actions/setup-java-with-retry
with:
java-version: "17"
distribution: "temurin"
cache: maven
- name: Ensure Maven wrapper JAR
run: bash .github/scripts/ensure-maven-wrapper.sh
- name: Build ShenYu local Maven repository
shell: bash
env:
RELEASE_CANDIDATE: ${{ github.event_name == 'workflow_dispatch' && inputs.release_candidate || false }}
run: |
release_args=(-Prelease -Dmaven.javadoc.skip=true -DskipRemoteResources=true)
if [[ "$RELEASE_CANDIDATE" == "true" ]]; then
python3 - <<'PYTHON'
import xml.etree.ElementTree as ET
root = ET.parse('pom.xml').getroot()
version = root.findtext('{http://maven.apache.org/POM/4.0.0}version')
if not version or 'SNAPSHOT' in version:
raise SystemExit('Release candidates require a non-SNAPSHOT project version')
print('Building unsigned release candidate:', version)
PYTHON
release_args=(-Prelease,apache-release -Dmaven.javadoc.skip=false -Dgpg.skip=true -DskipRemoteResources=false)
fi
./mvnw -B -ntp -T 1C install "${release_args[@]}" -DskipTests \
-Djacoco.skip=true -Drat.skip=true
mkdir -p /tmp/shenyu-m2
if [[ "$RELEASE_CANDIDATE" == "true" ]]; then
release_version="$(python3 -c "import xml.etree.ElementTree as E; print(E.parse('pom.xml').getroot().findtext('{http://maven.apache.org/POM/4.0.0}version'))")"
repository_paths=()
for artifact_dir in "${HOME}/.m2/repository/org/apache/shenyu/"*; do
if [[ -d "${artifact_dir}/${release_version}" ]]; then
repository_paths+=("org/apache/shenyu/${artifact_dir##*/}/${release_version}")
fi
done
[[ ${#repository_paths[@]} -gt 0 ]] || { echo "No ${release_version} Maven artifacts found" >&2; exit 1; }
tar -czf /tmp/shenyu-m2/repository.tar.gz -C "${HOME}/.m2/repository" "${repository_paths[@]}"
else
tar -czf /tmp/shenyu-m2/repository.tar.gz -C "${HOME}/.m2/repository" org/apache/shenyu
fi
cp .mvn/wrapper/maven-wrapper.jar /tmp/shenyu-m2/maven-wrapper.jar
- name: Check every candidate Maven JAR and both source distributions
if: github.event_name == 'workflow_dispatch' && inputs.release_candidate
run: python3 .github/scripts/check-release-artifacts.py --repository "${HOME}/.m2/repository/org/apache/shenyu"
- name: Resolve distribution runtime dependencies
run: |
bash .github/scripts/maven-with-retry.sh ./mvnw -B -ntp -pl shenyu-admin,shenyu-bootstrap,shenyu-dist/shenyu-admin-dist,shenyu-dist/shenyu-bootstrap-dist dependency:list \
-DincludeScope=runtime -DoutputFile=target/release-runtime-dependencies.txt
python3 .github/scripts/collect-release-licenses.py
# Fetch the verifier after packaging so its sources cannot enter the source archive.
- name: Check out the pinned ShenYu license verifier
if: github.event_name == 'workflow_dispatch' && inputs.release_candidate
uses: actions/checkout@v4
with:
repository: apache/shenyu-watcher
ref: 94c1bb95ffc65038ea8be4c15fda5167d8d6b675
path: .release-tools/shenyu-watcher
- name: Check candidate distribution licenses
if: github.event_name == 'workflow_dispatch' && inputs.release_candidate
shell: bash
run: |
python3 .github/scripts/collect-release-licenses.py --check
audit_root="${RUNNER_TEMP}/shenyu-release-license-audit"
for component in admin bootstrap; do
archives=("shenyu-dist/shenyu-${component}-dist/target/"apache-shenyu-*-"${component}"-bin.tar.gz)
[[ ${#archives[@]} -eq 1 && -f "${archives[0]}" ]]
mkdir -p "${audit_root}/${component}"
tar -xzf "${archives[0]}" -C "${audit_root}/${component}"
distributions=("${audit_root}/${component}/"apache-shenyu-*-"${component}"-bin)
[[ ${#distributions[@]} -eq 1 && -d "${distributions[0]}/lib" ]]
# The verifier CLI prints failures with exit code zero; enforce its result explicitly.
python3 - "${distributions[0]}/lib" "shenyu-dist/shenyu-${component}-dist" "${distributions[0]}/LICENSE" <<'PYTHON'
import importlib.util
import sys
spec = importlib.util.spec_from_file_location('release_watcher', '.release-tools/shenyu-watcher/shenyu_watcher.py')
watcher = importlib.util.module_from_spec(spec)
sys.modules[spec.name] = watcher
spec.loader.exec_module(watcher)
result = watcher.run_check(sys.argv[2], sys.argv[3], lib_dir=sys.argv[1])
watcher.print_result(result)
if not result.checked or result.unmatched or result.parse_failures:
raise SystemExit('Candidate dependency license declarations are incomplete')
PYTHON
done
- name: Upload distribution runtime dependency reports
uses: actions/upload-artifact@v4
with:
name: shenyu-release-runtime-dependencies
path: |
shenyu-admin/target/release-runtime-dependencies.txt
shenyu-bootstrap/target/release-runtime-dependencies.txt
shenyu-dist/shenyu-admin-dist/target/release-runtime-dependencies.txt
shenyu-dist/shenyu-bootstrap-dist/target/release-runtime-dependencies.txt
target/release-audit/*.json
if-no-files-found: error
retention-days: 7
- name: Upload ShenYu local Maven repository
uses: actions/upload-artifact@v4
with:
name: shenyu-local-maven-repository
path: /tmp/shenyu-m2/
compression-level: 0
if-no-files-found: error
retention-days: 1
source_release_check:
needs: build_local_repo
if: github.repository == 'apache/shenyu' && github.event_name == 'workflow_dispatch' && inputs.release_candidate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./actions/setup-java-with-retry
with:
java-version: "17"
distribution: "temurin"
cache: maven
- name: Ensure Maven wrapper JAR
run: bash .github/scripts/ensure-maven-wrapper.sh
- uses: actions/download-artifact@v4
with:
name: shenyu-local-maven-repository
path: /tmp/shenyu-m2
- name: Restore release artifacts
run: bash .github/scripts/restore-shenyu-local-repo.sh /tmp/shenyu-m2
- name: Ensure Maven wrapper JAR
run: bash .github/scripts/ensure-maven-wrapper.sh
- name: Rebuild the source distribution and run the complete default reactor tests
shell: bash
run: |
version="$(python3 -c "import xml.etree.ElementTree as E; print(E.parse('pom.xml').getroot().findtext('{http://maven.apache.org/POM/4.0.0}version'))")"
source_archive="${HOME}/.m2/repository/org/apache/shenyu/shenyu-src-dist/${version}/shenyu-src-dist-${version}-src.zip"
source_root="${RUNNER_TEMP}/shenyu-source-check"
mkdir -p "$source_root"
unzip -q "$source_archive" -d "$source_root"
cd "${source_root}/apache-shenyu-${version}-src"
bash "${GITHUB_WORKSPACE}/.github/scripts/ensure-maven-wrapper.sh"
bash "${GITHUB_WORKSPACE}/.github/scripts/maven-with-retry.sh" ./mvnw -B -ntp install -Djacoco.skip=true -Dmaven.javadoc.skip=true
# Repeat the counter synchronization and registry callback regressions after the full source build.
for attempt in {1..10}; do
./mvnw -B -ntp -pl shenyu-admin test -Dtest=ShenyuClusterServiceTest,ZookeeperClientDiscoveryIntegrationTest -Djacoco.skip=true -Dmaven.javadoc.skip=true
done
python3 - <<'PYTHON'
from pathlib import Path
import re
import zipfile
with zipfile.ZipFile('shenyu-admin/target/shenyu-admin.jar') as jar:
html = jar.read('static/index.html').decode()
for reference in re.findall(r'(?:src|href)=["\x27]([^"\x27]+\.(?:js|css))["\x27]', html):
assert jar.read('static/' + reference.removeprefix('./')), reference
assert 'Apache ShenYu' in jar.read('META-INF/NOTICE').decode()
print('Source-built Admin contains all referenced dashboard JS/CSS and project NOTICE')
PYTHON
- name: Upload source build test evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: shenyu-source-release-validation
path: |
${{ runner.temp }}/shenyu-source-check/**/target/surefire-reports/*.xml
${{ runner.temp }}/shenyu-source-check/**/target/rat.txt
if-no-files-found: warn
retention-days: 7
test_group:
needs:
- changes
- build_local_repo
runs-on: ubuntu-latest
if: github.repository == 'apache/shenyu' && (github.event_name != 'pull_request' || needs.changes.outputs.full_build_required == 'true') && needs.changes.outputs.code == 'true'
strategy:
fail-fast: false
matrix:
include:
- name: core
modules: shenyu-common,shenyu-spi,shenyu-disruptor,shenyu-protocol,shenyu-loadbalancer
- name: gateway-runtime
modules: shenyu-web,shenyu-bootstrap
- name: starters
modules: shenyu-spring-boot-starter,!shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-agent-gateway
- name: starters-agent
modules: shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-agent-gateway
- name: admin
modules: shenyu-admin
- name: sync
modules: shenyu-admin-listener,shenyu-sync-data-center
- name: plugin-base
modules: shenyu-plugin/shenyu-plugin-api,shenyu-plugin/shenyu-plugin-wasm-api,shenyu-plugin/shenyu-plugin-base,shenyu-plugin/shenyu-plugin-wasm-base,shenyu-plugin/shenyu-plugin-httpclient,shenyu-plugin/shenyu-plugin-rewrite,shenyu-plugin/shenyu-plugin-waf,shenyu-plugin/shenyu-plugin-global,shenyu-plugin/shenyu-plugin-context-path,shenyu-plugin/shenyu-plugin-redirect,shenyu-plugin/shenyu-plugin-modify-response,shenyu-plugin/shenyu-plugin-request,shenyu-plugin/shenyu-plugin-response,shenyu-plugin/shenyu-plugin-param-mapping,shenyu-plugin/shenyu-plugin-uri,shenyu-plugin/shenyu-plugin-metrics,shenyu-plugin/shenyu-plugin-tracing,shenyu-plugin/shenyu-plugin-cache,shenyu-plugin/shenyu-plugin-mock
- name: plugin-logging
modules: shenyu-plugin/shenyu-plugin-logging
- name: plugin-proxy
modules: shenyu-plugin/shenyu-plugin-proxy,shenyu-plugin/shenyu-plugin-security,shenyu-plugin/shenyu-plugin-fault-tolerance
- name: plugin-ai
modules: shenyu-plugin/shenyu-plugin-ai,shenyu-plugin/shenyu-plugin-agent-gateway,shenyu-plugin/shenyu-plugin-mcp-server
- name: client-register-registry
modules: shenyu-client,shenyu-register-center,shenyu-registry
- name: dist-extra
modules: shenyu-dist,shenyu-sdk,shenyu-alert,shenyu-kubernetes-controller,shenyu-infra
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./actions/setup-java-with-retry
with:
java-version: "17"
distribution: "temurin"
cache: maven
- uses: actions/download-artifact@v4
with:
name: shenyu-local-maven-repository
path: /tmp/shenyu-m2
- name: Restore ShenYu local Maven repository
run: bash .github/scripts/restore-shenyu-local-repo.sh /tmp/shenyu-m2
- name: Ensure Maven wrapper JAR
run: bash .github/scripts/ensure-maven-wrapper.sh
# The producer already checks main and test source style for the complete reactor.
- name: Run Maven tests
shell: bash
run: |
modules="$(GROUP_ROOTS="${{ matrix.modules }}" bash .github/scripts/expand-ci-module-roots.sh)"
echo "Testing Maven modules: ${modules}"
./mvnw -B -ntp -T 1C -pl "${modules}" test -Prelease -DskipRemoteResources=true -Dcheckstyle.skip=true
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.name }}
compat_java21:
needs:
- changes
- build_local_repo
runs-on: ubuntu-latest
if: github.repository == 'apache/shenyu' && (github.event_name != 'pull_request' || needs.changes.outputs.full_build_required == 'true') && needs.changes.outputs.code == 'true'
strategy:
fail-fast: false
matrix:
include:
- name: core
modules: shenyu-common,shenyu-spi,shenyu-disruptor,shenyu-protocol,shenyu-loadbalancer
- name: gateway-runtime
modules: shenyu-web,shenyu-bootstrap
- name: starters
modules: shenyu-spring-boot-starter,!shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-agent-gateway
- name: starters-agent
modules: shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-agent-gateway
- name: admin
modules: shenyu-admin
- name: sync
modules: shenyu-admin-listener,shenyu-sync-data-center
- name: plugin-base
modules: shenyu-plugin/shenyu-plugin-api,shenyu-plugin/shenyu-plugin-wasm-api,shenyu-plugin/shenyu-plugin-base,shenyu-plugin/shenyu-plugin-wasm-base,shenyu-plugin/shenyu-plugin-httpclient,shenyu-plugin/shenyu-plugin-rewrite,shenyu-plugin/shenyu-plugin-waf,shenyu-plugin/shenyu-plugin-global,shenyu-plugin/shenyu-plugin-context-path,shenyu-plugin/shenyu-plugin-redirect,shenyu-plugin/shenyu-plugin-modify-response,shenyu-plugin/shenyu-plugin-request,shenyu-plugin/shenyu-plugin-response,shenyu-plugin/shenyu-plugin-param-mapping,shenyu-plugin/shenyu-plugin-uri,shenyu-plugin/shenyu-plugin-metrics,shenyu-plugin/shenyu-plugin-tracing,shenyu-plugin/shenyu-plugin-cache,shenyu-plugin/shenyu-plugin-mock
- name: plugin-logging
modules: shenyu-plugin/shenyu-plugin-logging
- name: plugin-proxy
modules: shenyu-plugin/shenyu-plugin-proxy,shenyu-plugin/shenyu-plugin-security,shenyu-plugin/shenyu-plugin-fault-tolerance
- name: plugin-ai
modules: shenyu-plugin/shenyu-plugin-ai,shenyu-plugin/shenyu-plugin-agent-gateway,shenyu-plugin/shenyu-plugin-mcp-server
- name: client-register-registry
modules: shenyu-client,shenyu-register-center,shenyu-registry
- name: dist-extra
modules: shenyu-dist,shenyu-sdk,shenyu-alert,shenyu-kubernetes-controller,shenyu-infra
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./actions/setup-java-with-retry
with:
java-version: "21"
distribution: "temurin"
cache: maven
- uses: actions/download-artifact@v4
with:
name: shenyu-local-maven-repository
path: /tmp/shenyu-m2
- name: Restore ShenYu local Maven repository
run: bash .github/scripts/restore-shenyu-local-repo.sh /tmp/shenyu-m2
- name: Ensure Maven wrapper JAR
run: bash .github/scripts/ensure-maven-wrapper.sh
# Reuse the producer's Checkstyle result; preserve all Java 21 test execution.
- name: Run Java 21 compatibility tests
shell: bash
run: |
modules="$(GROUP_ROOTS="${{ matrix.modules }}" bash .github/scripts/expand-ci-module-roots.sh)"
./mvnw -B -ntp -T 1C -pl "${modules}" test -Prelease -DskipRemoteResources=true -Dcheckstyle.skip=true -Djacoco.skip=true
- name: Repeat actual HTTP cancellation and peer isolation on Java 21
if: github.event_name == 'workflow_dispatch' && inputs.release_candidate && matrix.name == 'plugin-ai'
run: |
for attempt in {1..10}; do
./mvnw -B -ntp -pl shenyu-plugin/shenyu-plugin-agent-gateway test -Dtest=RemoteResourceNetworkTest \
-Prelease -DskipRemoteResources=true -Dcheckstyle.skip=true -Djacoco.skip=true
done
check-license-header:
name: check-license-header
needs: changes
if: github.repository == 'apache/shenyu' && (needs.changes.outputs.rat_required == 'true' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Check License Header
uses: apache/skywalking-eyes@a196742f472feaffafea537ce5a2a4c3c53a8de4 # v0.9.0; supports REM headers in Windows batch files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
requirement:
name: build
if: github.repository == 'apache/shenyu' && !cancelled()
needs:
- changes
- rat_check
- agent_gateway_migrations
- registry_dependencies
- plugin_contract
- check-license-header
- pr_build
- build_local_repo
- test_group
- compat_java21
- source_release_check
runs-on: ubuntu-latest
steps:
- name: checking job status
run: |
[[ "${{ needs.changes.result }}" == "success" ]] || exit 1
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.release_candidate }}" == "true" ]]; then
[[ "${{ needs.source_release_check.result }}" == "success" ]] || exit 1
fi
if [[ "${{ needs.changes.outputs.code }}" == "true" ]]; then
[[ "${{ needs.registry_dependencies.result }}" == "success" ]] || exit 1
[[ "${{ needs.plugin_contract.result }}" == "success" ]] || exit 1
[[ "${{ needs.agent_gateway_migrations.result }}" == "success" ]] || exit 1
fi
if [[ "${{ needs.changes.outputs.rat_required }}" == "true" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
[[ "${{ needs.rat_check.result }}" == "success" ]] || exit 1
[[ "${{ needs.check-license-header.result }}" == "success" ]] || exit 1
fi
if [[ "${{ needs.changes.outputs.code }}" == "true" && "${{ github.event_name }}" == "pull_request" && "${{ needs.changes.outputs.full_build_required }}" != "true" ]]; then
[[ "${{ needs.pr_build.result }}" == "success" ]] || exit 1
fi
if [[ "${{ needs.changes.outputs.code }}" == "true" && ("${{ github.event_name }}" != "pull_request" || "${{ needs.changes.outputs.full_build_required }}" == "true") ]]; then
[[ "${{ needs.build_local_repo.result }}" == "success" ]] || exit 1
[[ "${{ needs.test_group.result }}" == "success" ]] || exit 1
[[ "${{ needs.compat_java21.result }}" == "success" ]] || exit 1
fi