|
| 1 | +name: Run TCK |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "main" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "main" ] |
| 8 | + paths-ignore: |
| 9 | + - '**.md' |
| 10 | + - 'LICENSE' |
| 11 | + - '.github/CODEOWNERS' |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + |
| 16 | +env: |
| 17 | + TCK_VERSION: 0.3.0.beta3 |
| 18 | + SUT_BASE_URL: http://localhost:41241 |
| 19 | + SUT_JSONRPC_URL: http://localhost:41241/a2a/jsonrpc |
| 20 | + UV_SYSTEM_PYTHON: 1 |
| 21 | + TCK_STREAMING_TIMEOUT: 5.0 |
| 22 | + |
| 23 | +concurrency: |
| 24 | + group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}' |
| 25 | + cancel-in-progress: true |
| 26 | + |
| 27 | +jobs: |
| 28 | + tck-test: |
| 29 | + name: Run TCK with Python ${{ matrix.python-version }} |
| 30 | + runs-on: ubuntu-latest |
| 31 | + strategy: |
| 32 | + matrix: |
| 33 | + python-version: ['3.10', '3.13'] |
| 34 | + steps: |
| 35 | + - name: Checkout a2a-python |
| 36 | + uses: actions/checkout@v6 |
| 37 | + |
| 38 | + - name: Install uv |
| 39 | + uses: astral-sh/setup-uv@v7 |
| 40 | + with: |
| 41 | + enable-cache: true |
| 42 | + cache-dependency-glob: "uv.lock" |
| 43 | + |
| 44 | + - name: Set up Python ${{ matrix.python-version }} |
| 45 | + run: uv python install ${{ matrix.python-version }} |
| 46 | + |
| 47 | + - name: Install Dependencies |
| 48 | + run: uv sync --locked --all-extras |
| 49 | + |
| 50 | + - name: Checkout a2a-tck |
| 51 | + uses: actions/checkout@v6 |
| 52 | + with: |
| 53 | + repository: a2aproject/a2a-tck |
| 54 | + path: tck/a2a-tck |
| 55 | + ref: ${{ env.TCK_VERSION }} |
| 56 | + |
| 57 | + - name: Start SUT |
| 58 | + run: | |
| 59 | + uv run tck/sut_agent.py & |
| 60 | +
|
| 61 | + - name: Wait for SUT to start |
| 62 | + run: | |
| 63 | + URL="${{ env.SUT_BASE_URL }}/.well-known/agent-card.json" |
| 64 | + EXPECTED_STATUS=200 |
| 65 | + TIMEOUT=120 |
| 66 | + RETRY_INTERVAL=2 |
| 67 | + START_TIME=$(date +%s) |
| 68 | +
|
| 69 | + while true; do |
| 70 | + CURRENT_TIME=$(date +%s) |
| 71 | + ELAPSED_TIME=$((CURRENT_TIME - START_TIME)) |
| 72 | +
|
| 73 | + if [ "$ELAPSED_TIME" -ge "$TIMEOUT" ]; then |
| 74 | + echo "❌ Timeout: Server did not respond with status $EXPECTED_STATUS within $TIMEOUT seconds." |
| 75 | + exit 1 |
| 76 | + fi |
| 77 | +
|
| 78 | + HTTP_STATUS=$(curl --output /dev/null --silent --write-out "%{http_code}" "$URL") || true |
| 79 | + echo "STATUS: ${HTTP_STATUS}" |
| 80 | +
|
| 81 | + if [ "$HTTP_STATUS" -eq "$EXPECTED_STATUS" ]; then |
| 82 | + echo "✅ Server is up! Received status $HTTP_STATUS after $ELAPSED_TIME seconds." |
| 83 | + break; |
| 84 | + fi |
| 85 | +
|
| 86 | + echo "⏳ Server not ready (status: $HTTP_STATUS). Retrying in $RETRY_INTERVAL seconds..." |
| 87 | + sleep "$RETRY_INTERVAL" |
| 88 | + done |
| 89 | +
|
| 90 | + - name: Run TCK (mandatory) |
| 91 | + id: run-tck-mandatory |
| 92 | + run: | |
| 93 | + uv run run_tck.py --sut-url ${{ env.SUT_JSONRPC_URL }} --category mandatory --transports jsonrpc |
| 94 | + working-directory: tck/a2a-tck |
| 95 | + |
| 96 | + - name: Run TCK (capabilities) |
| 97 | + id: run-tck-capabilities |
| 98 | + run: | |
| 99 | + uv run run_tck.py --sut-url ${{ env.SUT_JSONRPC_URL }} --category capabilities --transports jsonrpc |
| 100 | + working-directory: tck/a2a-tck |
| 101 | + |
| 102 | + - name: Stop SUT |
| 103 | + if: always() |
| 104 | + run: | |
| 105 | + pkill -f sut_agent.py || true |
| 106 | + sleep 2 |
0 commit comments