-
Notifications
You must be signed in to change notification settings - Fork 1
156 lines (145 loc) · 5.39 KB
/
Copy pathci.yml
File metadata and controls
156 lines (145 loc) · 5.39 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
name: ci
on:
push:
branches: [main]
paths-ignore:
- "**.md"
- "LICENSE"
- ".gitignore"
- ".editorconfig"
- "docs/diagrams/**" # diagrams workflow owns these
pull_request:
branches: [main]
paths-ignore:
- "**.md"
- "LICENSE"
- ".gitignore"
- ".editorconfig"
- "docs/diagrams/**"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
build:
name: build (JDK ${{ matrix.jdk }})
runs-on: [self-hosted, linux, arm64, arcp]
strategy:
fail-fast: false
matrix:
# 21 is the LTS floor (`--release 21`); 25 is the September 2025 LTS
# and matches the toolchain the local developer setup uses. Both must
# produce green tests on every PR.
jdk: ["21", "25"]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ matrix.jdk }}
# Built-in Maven cache: keys off pom.xml hashes and restores ~/.m2/repository.
cache: maven
- name: Check formatting (Spotless)
if: ${{ matrix.jdk == '21' }}
run: mvn -B -ntp -Darcp.skip.spotless=false spotless:check
- name: Build and test
# JDK 25 skips spotless because google-java-format embedded in the pinned
# spotless version cannot run against JDK 25's javac internals.
# `install` (not `verify`) so subsequent `mvn -f <module>/pom.xml` steps
# resolve our SNAPSHOTs from the local repository.
run: |
if [[ "${{ matrix.jdk }}" == "21" ]]; then
mvn -B -ntp -Dmaven.javadoc.skip=true install
else
mvn -B -ntp -Dmaven.javadoc.skip=true -Darcp.skip.spotless=true install
fi
- name: Run all runnable examples and recipes
# `-f <module>/pom.xml` scopes exec:java to the leaf module only.
# Using `-pl <module> -am exec:java` runs exec:java on every reactor
# module pulled in by -am (including the parent pom), which fails
# because no mainClass is defined there.
run: |
for module in \
examples/submit-and-stream \
examples/cancel \
examples/heartbeat \
examples/cost-budget \
examples/result-chunk \
examples/agent-versions \
examples/list-jobs \
examples/lease-expires-at \
examples/idempotent-retry \
examples/custom-auth \
examples/provisioned-credentials \
examples/ack-backpressure \
examples/delegate \
examples/spring-boot \
examples/jakarta \
examples/lease-violation \
examples/progress \
examples/resume \
examples/stdio \
examples/subscribe \
examples/tracing \
examples/vendor-extensions \
recipes/email-vendor-leases \
recipes/mcp-skill \
recipes/multi-agent-budget \
recipes/stream-resume
do
echo "::group::run $module"
mvn -B -ntp -f "$module/pom.xml" -Darcp.skip.spotless=true \
-Dmaven.javadoc.skip=true -Dmaven.test.skip=true \
-Dexec.cleanupDaemonThreads=false exec:java
echo "::endgroup::"
done
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v7
with:
name: test-reports-jdk${{ matrix.jdk }}
path: |
**/target/surefire-reports/
**/target/site/jacoco/
if-no-files-found: ignore
retention-days: 7
# jacoco-maven-plugin (configured in the parent pom) writes per-module
# XML reports to target/site/jacoco/jacoco.xml — the path the Codecov
# example-java-maven repo uses. Upload from the LTS floor only; coverage
# is identical across JDKs. Non-blocking.
- name: Upload coverage to Codecov
if: matrix.jdk == '21'
# codecov/codecov-action v6.0.1
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
fail_ci_if_error: false
flags: unittests
files: "**/target/site/jacoco/jacoco.xml"
token: ${{ secrets.CODECOV_TOKEN }}
javadoc:
name: javadoc
runs-on: [self-hosted, linux, arm64, arcp]
needs: build
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"
cache: maven
- name: Build javadoc for all published modules
# `package` before javadoc:javadoc so inter-module dependencies resolve
# from this reactor's output instead of a (possibly stale) cached
# SNAPSHOT in the runner's local repository — otherwise javadoc cannot
# see classes a PR adds to an upstream module like arcp-core.
run: |
mvn -B -ntp -am -DskipTests -Darcp.skip.spotless=true \
-pl arcp-core,arcp-client,arcp-runtime,arcp,arcp-otel,arcp-runtime-jetty,arcp-middleware-jakarta,arcp-middleware-spring-boot,arcp-middleware-vertx,arcp-tck \
package javadoc:javadoc