|
| 1 | +name: Cloud Deployment Example Test (Windows) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +# Only run the latest job |
| 9 | +concurrency: |
| 10 | + group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}' |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + test-cloud-deployment-windows: |
| 15 | + runs-on: windows-latest |
| 16 | + timeout-minutes: 45 |
| 17 | + steps: |
| 18 | + - name: Checkout code |
| 19 | + uses: actions/checkout@v6 |
| 20 | + |
| 21 | + - name: Set up JDK 17 |
| 22 | + uses: actions/setup-java@v5 |
| 23 | + with: |
| 24 | + java-version: '17' |
| 25 | + distribution: 'temurin' |
| 26 | + cache: maven |
| 27 | + |
| 28 | + - name: Install Kind |
| 29 | + shell: pwsh |
| 30 | + run: | |
| 31 | + curl.exe -Lo kind.exe https://kind.sigs.k8s.io/dl/v0.31.0/kind-windows-amd64.exe |
| 32 | + Move-Item kind.exe "$env:SystemRoot\System32\kind.exe" |
| 33 | + kind version |
| 34 | +
|
| 35 | + - name: Build project |
| 36 | + run: mvn -B clean install -DskipTests -f pom.xml |
| 37 | + |
| 38 | + - name: Deploy with Kind |
| 39 | + working-directory: examples/cloud-deployment/scripts |
| 40 | + shell: pwsh |
| 41 | + run: .\deploy.ps1 |
| 42 | + |
| 43 | + - name: Verify deployment |
| 44 | + working-directory: examples/cloud-deployment/scripts |
| 45 | + shell: pwsh |
| 46 | + run: .\verify.ps1 |
| 47 | + |
| 48 | + - name: Verify agent card is accessible |
| 49 | + shell: pwsh |
| 50 | + run: | |
| 51 | + Write-Host "Testing agent card endpoint at http://localhost:8080/.well-known/agent-card.json" |
| 52 | + curl.exe -f http://localhost:8080/.well-known/agent-card.json |
| 53 | + if ($LASTEXITCODE -ne 0) { |
| 54 | + Write-Host "Agent card not accessible" -ForegroundColor Red |
| 55 | + exit 1 |
| 56 | + } |
| 57 | +
|
| 58 | + - name: Run test client |
| 59 | + working-directory: examples/cloud-deployment/server |
| 60 | + shell: pwsh |
| 61 | + run: | |
| 62 | + mvn test-compile exec:java ` |
| 63 | + -Dexec.mainClass="org.a2aproject.sdk.examples.cloud.A2ACloudExampleClient" ` |
| 64 | + -Dexec.classpathScope=test ` |
| 65 | + -Dagent.url=http://localhost:8080 ` |
| 66 | + -Dci.mode=true |
| 67 | +
|
| 68 | + - name: Show diagnostics on failure |
| 69 | + if: failure() |
| 70 | + shell: pwsh |
| 71 | + run: | |
| 72 | + Write-Host "=== Agent Pod Status ===" |
| 73 | + kubectl get pods -n a2a-demo -l app=a2a-agent -o wide |
| 74 | +
|
| 75 | + Write-Host "" |
| 76 | + Write-Host "=== Recent Events ===" |
| 77 | + kubectl get events -n a2a-demo --sort-by='.lastTimestamp' | Select-Object -Last 20 |
| 78 | +
|
| 79 | + Write-Host "" |
| 80 | + Write-Host "=== Agent Pod Logs ===" |
| 81 | + $pods = (kubectl get pods -n a2a-demo -l app=a2a-agent ` |
| 82 | + -o jsonpath='{.items[*].metadata.name}') -split ' ' |
| 83 | + foreach ($pod in $pods) { |
| 84 | + if ($pod) { |
| 85 | + Write-Host "--- Logs for $pod ---" |
| 86 | + kubectl logs -n a2a-demo $pod --tail=100 |
| 87 | + } |
| 88 | + } |
| 89 | +
|
| 90 | + Write-Host "" |
| 91 | + Write-Host "=== PostgreSQL Logs ===" |
| 92 | + kubectl logs -n a2a-demo postgres-0 --tail=50 |
| 93 | +
|
| 94 | + Write-Host "" |
| 95 | + Write-Host "=== Kafka Logs ===" |
| 96 | + kubectl logs -n kafka -l strimzi.io/cluster=a2a-kafka --tail=50 |
| 97 | +
|
| 98 | + - name: Cleanup |
| 99 | + if: always() |
| 100 | + working-directory: examples/cloud-deployment/scripts |
| 101 | + shell: pwsh |
| 102 | + run: .\cleanup.ps1 -Force |
0 commit comments