Skip to content

Commit 25e957c

Browse files
committed
GitHub Actions workflow to run the TCK
1 parent 884dfdb commit 25e957c

File tree

2 files changed

+102
-1
lines changed

2 files changed

+102
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ 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
26+

.github/workflows/run-tck.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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+
# Version of uv
18+
UV_VERSION: "0.7.19"
19+
20+
# Only run the latest job
21+
concurrency:
22+
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
23+
cancel-in-progress: true
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout a2a-java
30+
uses: actions/checkout@v4
31+
with:
32+
path: a2a-java
33+
- name: Checkout a2a-tck
34+
uses: actions/checkout@v4
35+
with:
36+
repository: maeste/a2a-tck
37+
path: a2a-tck
38+
ref: ${{ env.TCK_VERSION }}
39+
- name: Set up JDK 17
40+
uses: actions/setup-java@v4
41+
with:
42+
java-version: '17'
43+
distribution: 'temurin'
44+
cache: maven
45+
- name: Install uv
46+
uses: astral-sh/setup-uv@v5
47+
with:
48+
# Install a specific version of uv.
49+
version: ${{ env.UV_VERSION }}
50+
enable-cache: true
51+
- name: Set up Python
52+
uses: actions/setup-python@v5
53+
with:
54+
python-version-file: "a2a-tck/pyproject.toml"
55+
- name: Install Python requirements
56+
run: uv pip install -e .
57+
working-directory: a2a-tck
58+
- name: Build with Maven, skipping tests
59+
run: mvn -B install -DskipTests
60+
working-directory: a2a-java
61+
- name: Start Quarkus
62+
run: mvn quarkus:dev &
63+
working-directory: a2a-java/tck
64+
- name: Wait for server to start
65+
run: |
66+
URL="http://localhost:9999/.well-known/agent.json"
67+
EXPECTED_STATUS=200
68+
TIMEOUT=120
69+
RETRY_INTERVAL=2
70+
START_TIME=$(date +%s)
71+
72+
while true; do
73+
# Calculate elapsed time
74+
CURRENT_TIME=$(date +%s)
75+
ELAPSED_TIME=$((CURRENT_TIME - START_TIME))
76+
77+
# Check for timeout
78+
if [ "$ELAPSED_TIME" -ge "$TIMEOUT" ]; then
79+
echo "Timeout: Server did not respond with status $EXPECTED_STATUS within $TIMEOUT seconds."
80+
exit 1
81+
fi
82+
83+
# Get HTTP status code. || true is to reporting a failure to connect as an error
84+
HTTP_STATUS=$(curl --output /dev/null --silent --write-out "%{http_code}" "$URL") || true
85+
echo "STATUS: ${HTTP_STATUS}"
86+
87+
# Check if we got the correct status code
88+
if [ "$HTTP_STATUS" -eq "$EXPECTED_STATUS" ]; then
89+
echo "Server is up! Received status $HTTP_STATUS after $ELAPSED_TIME seconds."
90+
exit 0
91+
fi
92+
93+
# Wait before retrying
94+
echo "Server not ready (status: $HTTP_STATUS). Retrying in $RETRY_INTERVAL seconds..."
95+
sleep "$RETRY_INTERVAL"
96+
done
97+
98+
- name: Run TCK
99+
run: ./run_tck.py --category all --sut-url http://localhost:9999
100+
working-directory: a2a-tck

0 commit comments

Comments
 (0)