Skip to content

Commit 4b3e1cf

Browse files
dev-jonghoonparkkabir
authored andcommitted
feat: Add a2a-tck runs to CI for PRs (GH-152)
Signed-off-by: jonghoonpark <[email protected]>
1 parent f2dae4e commit 4b3e1cf

File tree

2 files changed

+94
-1
lines changed

2 files changed

+94
-1
lines changed

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ jobs:
2121
java-version: '17'
2222
distribution: 'temurin'
2323
cache: maven
24-
- name: Build with Maven
24+
- name: Build with Maven and run tests
2525
run: mvn -B package --file pom.xml -fae

.github/workflows/run-tck.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Run TCK
2+
3+
on:
4+
# Handle all branches for now
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
env:
13+
# Tag of the TCK
14+
TCK_VERSION: 0.2.3
15+
# Tells astral-sh/setup-uv@v5 to not need a venv, and instead use system
16+
UV_SYSTEM_PYTHON: 1
17+
18+
# Only run the latest job
19+
concurrency:
20+
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
21+
cancel-in-progress: true
22+
23+
jobs:
24+
tck-test:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout a2a-java
28+
uses: actions/checkout@v4
29+
- name: Checkout a2a-tck
30+
uses: actions/checkout@v4
31+
with:
32+
repository: maeste/a2a-tck
33+
path: tck/a2a-tck
34+
ref: ${{ env.TCK_VERSION }}
35+
- name: Set up JDK 17
36+
uses: actions/setup-java@v4
37+
with:
38+
java-version: '17'
39+
distribution: 'temurin'
40+
cache: maven
41+
- name: check java_home
42+
run: echo $JAVA_HOME
43+
- name: Set up Python
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: '3.11'
47+
- name: Install uv
48+
run: |
49+
pip install uv
50+
uv pip install -e .
51+
working-directory: tck/a2a-tck
52+
- name: Build with Maven, skipping tests
53+
run: mvn -B install -DskipTests
54+
- name: Start SUT & Run TCK
55+
run: |
56+
mvn -B quarkus:dev &
57+
58+
URL="http://localhost:9999/.well-known/agent.json"
59+
EXPECTED_STATUS=200
60+
TIMEOUT=120
61+
RETRY_INTERVAL=2
62+
START_TIME=$(date +%s)
63+
64+
while true; do
65+
# Calculate elapsed time
66+
CURRENT_TIME=$(date +%s)
67+
ELAPSED_TIME=$((CURRENT_TIME - START_TIME))
68+
69+
# Check for timeout
70+
if [ "$ELAPSED_TIME" -ge "$TIMEOUT" ]; then
71+
echo "❌ Timeout: Server did not respond with status $EXPECTED_STATUS within $TIMEOUT seconds."
72+
exit 1
73+
fi
74+
75+
# Get HTTP status code. || true is to reporting a failure to connect as an error
76+
HTTP_STATUS=$(curl --output /dev/null --silent --write-out "%{http_code}" "$URL") || true
77+
echo "STATUS: ${HTTP_STATUS}"
78+
79+
# Check if we got the correct status code
80+
if [ "$HTTP_STATUS" -eq "$EXPECTED_STATUS" ]; then
81+
echo "✅ Server is up! Received status $HTTP_STATUS after $ELAPSED_TIME seconds."
82+
break;
83+
fi
84+
85+
# Wait before retrying
86+
echo "⏳ Server not ready (status: $HTTP_STATUS). Retrying in $RETRY_INTERVAL seconds..."
87+
sleep "$RETRY_INTERVAL"
88+
done
89+
90+
# Run TCK
91+
cd a2a-tck
92+
./run_tck.py --sut-url http://localhost:9999 --category all --compliance-report report.json
93+
working-directory: tck

0 commit comments

Comments
 (0)