ci: update TCK workflow to use a2a-tck 1.0-dev branch with codegen SUT #1486
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run TCK | |
| on: | |
| # Handle all branches for now | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| env: | |
| # Tag/branch of the TCK | |
| TCK_VERSION: 1.0-dev | |
| # Tells uv to not need a venv, and instead use system | |
| UV_SYSTEM_PYTHON: 1 | |
| SUT_URL: http://localhost:9999 | |
| # 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, 21, 25] | |
| steps: | |
| - name: Checkout a2a-java | |
| uses: actions/checkout@v6 | |
| - name: Set up JDK ${{ matrix.java-version }} | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: ${{ matrix.java-version }} | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Build a2a-java SDK | |
| run: mvn -B install -DskipTests | |
| - name: Extract a2a-java version | |
| id: extract-version | |
| run: | | |
| A2A_JAVA_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
| echo "version=$A2A_JAVA_VERSION" >> $GITHUB_OUTPUT | |
| echo "Detected a2a-java version: $A2A_JAVA_VERSION" | |
| - name: Checkout a2a-tck | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: a2aproject/a2a-tck | |
| path: a2a-tck | |
| ref: ${{ env.TCK_VERSION }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| 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: Generate a2a-java SUT | |
| run: A2A_JAVA_SDK_VERSION=${{ steps.extract-version.outputs.version }} make codegen-a2a-java-sut | |
| working-directory: a2a-tck | |
| - name: Start SUT | |
| run: mvn -B quarkus:dev -Dquarkus.console.enabled=false & | |
| working-directory: a2a-tck/sut/a2a-java | |
| - 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 Results (Java ${{ matrix.java-version }})' >> $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@v6 | |
| with: | |
| name: tck-reports-java-${{ matrix.java-version }} | |
| path: a2a-tck/reports/ | |
| retention-days: 14 | |
| if-no-files-found: warn |