Skip to content

Commit ea50009

Browse files
committed
feat: add Windows CI workflow and -Force flag to cleanup.ps1
Adds a GitHub Actions workflow on windows-latest that mirrors the existing Linux cloud-deployment-example.yml, running deploy.ps1, verify.ps1, and cleanup.ps1 on a Windows runner. Adds a -Force switch to cleanup.ps1 to skip the interactive Read-Host confirmation prompt in CI environments.
1 parent 8f7a04f commit ea50009

2 files changed

Lines changed: 112 additions & 5 deletions

File tree

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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

‎examples/cloud-deployment/scripts/cleanup.ps1‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
#>
1717
param(
1818
[ValidateSet("docker", "podman")]
19-
[string]$ContainerTool = "docker"
19+
[string]$ContainerTool = "docker",
20+
[switch]$Force
2021
)
2122

2223
Write-Host "============================================"
@@ -30,11 +31,15 @@ if ($ContainerTool -eq "podman") {
3031
}
3132

3233
Write-Host "This will delete all resources in the a2a-demo namespace and the Kind cluster" -ForegroundColor Yellow
33-
$reply = Read-Host "Are you sure you want to continue? (y/N)"
3434

35-
if ($reply -notmatch "^[Yy]$") {
36-
Write-Host "Cleanup cancelled"
37-
exit 0
35+
if (-not $Force) {
36+
$reply = Read-Host "Are you sure you want to continue? (y/N)"
37+
if ($reply -notmatch "^[Yy]$") {
38+
Write-Host "Cleanup cancelled"
39+
exit 0
40+
}
41+
} else {
42+
Write-Host "Running in forced mode, skipping confirmation." -ForegroundColor Yellow
3843
}
3944

4045
Write-Host ""

0 commit comments

Comments
 (0)