Repository navigation
225 lines (210 loc) · 7.99 KB
/
Copy pathrun-tck.yml
File metadata and controls
225 lines (210 loc) · 7.99 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
name: Run TCK
on:
push:
branches:
- main
paths-ignore:
- '**/docs/**'
pull_request:
branches:
- main
paths-ignore:
- '**/docs/**'
workflow_dispatch:
env:
# Tag/branch of the TCK
TCK_VERSION: 1.0.0.alpha3
TCK_VERSION_0_3: 0.3.0.beta6
# Tells uv to not need a venv, and instead use system
UV_SYSTEM_PYTHON: 1
SUT_URL: http://localhost:9999
# Slow system on CI
TCK_STREAMING_TIMEOUT_0_3: 5.0
# Only run the latest job
concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
tck-test:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [17]
profile: ['', 'multi-version']
steps:
- name: Checkout a2a-java
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
- name: Build a2a-java SDK
run: mvn -B install -DskipTests
- name: Checkout a2a-tck
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: a2aproject/a2a-tck
path: a2a-tck
ref: ${{ env.TCK_VERSION }}
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7
with:
python-version-file: "a2a-tck/pyproject.toml"
- name: Install uv and Python dependencies
run: |
pip install uv
uv pip install -e .
working-directory: a2a-tck
- name: Start SUT
run: mvn -B quarkus:dev ${{ matrix.profile && format('-P{0}', matrix.profile) || '' }} -Dquarkus.console.enabled=false &
working-directory: tck
- name: Wait for SUT to start
run: |
URL="${{ env.SUT_URL }}/.well-known/agent-card.json"
EXPECTED_STATUS=200
TIMEOUT=120
RETRY_INTERVAL=2
START_TIME=$(date +%s)
while true; do
CURRENT_TIME=$(date +%s)
ELAPSED_TIME=$((CURRENT_TIME - START_TIME))
if [ "$ELAPSED_TIME" -ge "$TIMEOUT" ]; then
echo "Timeout: Server did not respond with status $EXPECTED_STATUS within $TIMEOUT seconds."
exit 1
fi
HTTP_STATUS=$(curl --output /dev/null --silent --write-out "%{http_code}" "$URL") || true
if [ "$HTTP_STATUS" -eq "$EXPECTED_STATUS" ]; then
echo "Server is up! Received status $HTTP_STATUS after $ELAPSED_TIME seconds."
break;
fi
echo "Server not ready (status: $HTTP_STATUS). Retrying in $RETRY_INTERVAL seconds..."
sleep "$RETRY_INTERVAL"
done
- name: Run TCK
id: run-tck
timeout-minutes: 5
run: |
set -o pipefail
uv run ./run_tck.py --sut-host ${{ env.SUT_URL }} -v 2>&1 | tee tck-output.log
working-directory: a2a-tck
- name: TCK Summary
if: always() && steps.run-tck.outcome != 'skipped'
run: |
if [ -f a2a-tck/tck-output.log ]; then
# Extract everything after the first ═══ separator line
SUMMARY=$(sed -n '/^═══/,$p' a2a-tck/tck-output.log)
if [ -n "$SUMMARY" ]; then
echo '### TCK 1.0 Results (Java ${{ matrix.java-version }}${{ matrix.profile && format(', {0}', matrix.profile) || '' }})' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
fi
- name: Stop SUT
if: always()
run: |
pkill -f "quarkus:dev" || true
sleep 2
- name: Upload TCK Reports
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: tck-reports-java-${{ matrix.java-version }}${{ matrix.profile && format('-{0}', matrix.profile) || '' }}
path: a2a-tck/reports/
retention-days: 14
if-no-files-found: warn
tck-test-0-3:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [17]
profile: ['', 'multi-version']
steps:
- name: Checkout a2a-java
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
- name: Build a2a-java SDK
run: mvn -B install -DskipTests
- name: Checkout a2a-tck
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: a2aproject/a2a-tck
path: a2a-tck
ref: ${{ env.TCK_VERSION_0_3 }}
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7
with:
python-version-file: "a2a-tck/pyproject.toml"
- name: Install uv and Python dependencies
run: |
pip install uv
uv pip install -e .
working-directory: a2a-tck
- name: Start SUT
run: mvn -B quarkus:dev ${{ matrix.profile && format('-P{0}', matrix.profile) || '' }} -Dquarkus.console.enabled=false &
working-directory: compat-0.3/tck
- name: Wait for SUT to start
run: |
URL="${{ env.SUT_URL }}/.well-known/agent-card.json"
EXPECTED_STATUS=200
TIMEOUT=120
RETRY_INTERVAL=2
START_TIME=$(date +%s)
while true; do
CURRENT_TIME=$(date +%s)
ELAPSED_TIME=$((CURRENT_TIME - START_TIME))
if [ "$ELAPSED_TIME" -ge "$TIMEOUT" ]; then
echo "Timeout: Server did not respond with status $EXPECTED_STATUS within $TIMEOUT seconds."
exit 1
fi
HTTP_STATUS=$(curl --output /dev/null --silent --write-out "%{http_code}" "$URL") || true
if [ "$HTTP_STATUS" -eq "$EXPECTED_STATUS" ]; then
echo "Server is up! Received status $HTTP_STATUS after $ELAPSED_TIME seconds."
break;
fi
echo "Server not ready (status: $HTTP_STATUS). Retrying in $RETRY_INTERVAL seconds..."
sleep "$RETRY_INTERVAL"
done
- name: Run TCK
id: run-tck
timeout-minutes: 5
env:
TCK_STREAMING_TIMEOUT: ${{ env.TCK_STREAMING_TIMEOUT_0_3 }}
run: |
set -o pipefail
./run_tck.py --sut-url ${{ env.SUT_URL }} --category all --transports jsonrpc,grpc,rest --compliance-report report.json 2>&1 | tee tck-output.log
working-directory: a2a-tck
- name: TCK Summary
if: always() && steps.run-tck.outcome != 'skipped'
run: |
if [ -f a2a-tck/tck-output.log ]; then
SUMMARY=$(sed -n '/^═══/,$p' a2a-tck/tck-output.log)
if [ -n "$SUMMARY" ]; then
echo '### TCK 0.3 Results (Java ${{ matrix.java-version }}${{ matrix.profile && format(', {0}', matrix.profile) || '' }})' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
fi
- name: Stop SUT
if: always()
run: |
pkill -f "quarkus:dev" || true
sleep 2
- name: Upload TCK Reports
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: tck-0.3-reports-java-${{ matrix.java-version }}${{ matrix.profile && format('-{0}', matrix.profile) || '' }}
path: |
a2a-tck/reports/
a2a-tck/report.json
retention-days: 14
if-no-files-found: warn