1+ name : Nightly Installer Tests
2+
3+ on :
4+ schedule :
5+ # Run at 2 AM UTC every day
6+ - cron : ' 0 2 * * *'
7+ workflow_dispatch : # Allow manual triggering
8+ inputs :
9+ platforms :
10+ description : ' Platforms to test (comma-separated: aws-eks,aws-ecs-ts,aws-ecs-go,azure-aks,gke)'
11+ required : false
12+ default : ' aws-eks,aws-ecs-ts,aws-ecs-go,azure-aks,gke'
13+ skip_validation :
14+ description : ' Skip service validation (true/false)'
15+ required : false
16+ default : ' false'
17+
18+ env :
19+ GO_VERSION : ' 1.23'
20+ NODE_VERSION : ' 20'
21+
22+ jobs :
23+ # Job to determine which platforms to test
24+ setup :
25+ runs-on : ubuntu-latest
26+ outputs :
27+ platforms : ${{ steps.platforms.outputs.platforms }}
28+ matrix : ${{ steps.platforms.outputs.matrix }}
29+ steps :
30+ - name : Determine platforms to test
31+ id : platforms
32+ run : |
33+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
34+ PLATFORMS="${{ github.event.inputs.platforms }}"
35+ else
36+ PLATFORMS="aws-eks,aws-ecs-ts,aws-ecs-go,azure-aks,gke"
37+ fi
38+
39+ echo "platforms=$PLATFORMS" >> $GITHUB_OUTPUT
40+
41+ # Convert to JSON matrix
42+ MATRIX=$(echo "$PLATFORMS" | jq -R -s -c 'split(",") | map(select(. != "")) | {platform: .}')
43+ echo "matrix=$MATRIX" >> $GITHUB_OUTPUT
44+
45+ echo "Will test platforms: $PLATFORMS"
46+
47+ # AWS EKS Tests
48+ test-aws-eks :
49+ needs : setup
50+ if : contains(needs.setup.outputs.platforms, 'aws-eks')
51+ runs-on : ubuntu-latest
52+ timeout-minutes : 120 # 2 hours max
53+ environment : nightly-tests
54+ steps :
55+ - name : Checkout code
56+ uses : actions/checkout@v4
57+
58+ - name : Setup Go
59+ uses : actions/setup-go@v4
60+ with :
61+ go-version : ${{ env.GO_VERSION }}
62+
63+ - name : Setup Node.js
64+ uses : actions/setup-node@v4
65+ with :
66+ node-version : ${{ env.NODE_VERSION }}
67+
68+ - name : Configure AWS credentials
69+ uses : aws-actions/configure-aws-credentials@v4
70+ with :
71+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
72+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
73+ aws-region : us-west-2
74+
75+ - name : Install Pulumi CLI
76+ uses : pulumi/actions@v4
77+
78+ - name : Run AWS EKS tests
79+ run : make test-aws-eks
80+ env :
81+ PULUMI_ACCESS_TOKEN : ${{ secrets.PULUMI_ACCESS_TOKEN }}
82+
83+ - name : Upload test results
84+ if : always()
85+ uses : actions/upload-artifact@v3
86+ with :
87+ name : aws-eks-test-results
88+ path : tests/test-results/
89+
90+ # AWS ECS TypeScript Tests
91+ test-aws-ecs-ts :
92+ needs : setup
93+ if : contains(needs.setup.outputs.platforms, 'aws-ecs-ts')
94+ runs-on : ubuntu-latest
95+ timeout-minutes : 90
96+ environment : nightly-tests
97+ steps :
98+ - name : Checkout code
99+ uses : actions/checkout@v4
100+
101+ - name : Setup Go
102+ uses : actions/setup-go@v4
103+ with :
104+ go-version : ${{ env.GO_VERSION }}
105+
106+ - name : Setup Node.js
107+ uses : actions/setup-node@v4
108+ with :
109+ node-version : ${{ env.NODE_VERSION }}
110+
111+ - name : Configure AWS credentials
112+ uses : aws-actions/configure-aws-credentials@v4
113+ with :
114+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
115+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
116+ aws-region : us-west-2
117+
118+ - name : Install Pulumi CLI
119+ uses : pulumi/actions@v4
120+
121+ - name : Run AWS ECS TypeScript tests
122+ run : make test-aws-ecs-ts
123+ env :
124+ PULUMI_ACCESS_TOKEN : ${{ secrets.PULUMI_ACCESS_TOKEN }}
125+
126+ - name : Upload test results
127+ if : always()
128+ uses : actions/upload-artifact@v3
129+ with :
130+ name : aws-ecs-ts-test-results
131+ path : tests/test-results/
132+
133+ # AWS ECS Go Tests
134+ test-aws-ecs-go :
135+ needs : setup
136+ if : contains(needs.setup.outputs.platforms, 'aws-ecs-go')
137+ runs-on : ubuntu-latest
138+ timeout-minutes : 90
139+ environment : nightly-tests
140+ steps :
141+ - name : Checkout code
142+ uses : actions/checkout@v4
143+
144+ - name : Setup Go
145+ uses : actions/setup-go@v4
146+ with :
147+ go-version : ${{ env.GO_VERSION }}
148+
149+ - name : Configure AWS credentials
150+ uses : aws-actions/configure-aws-credentials@v4
151+ with :
152+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
153+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
154+ aws-region : us-west-2
155+
156+ - name : Install Pulumi CLI
157+ uses : pulumi/actions@v4
158+
159+ - name : Run AWS ECS Go tests
160+ run : make test-aws-ecs-go
161+ env :
162+ PULUMI_ACCESS_TOKEN : ${{ secrets.PULUMI_ACCESS_TOKEN }}
163+
164+ - name : Upload test results
165+ if : always()
166+ uses : actions/upload-artifact@v3
167+ with :
168+ name : aws-ecs-go-test-results
169+ path : tests/test-results/
170+
171+ # Azure AKS Tests
172+ test-azure-aks :
173+ needs : setup
174+ if : contains(needs.setup.outputs.platforms, 'azure-aks')
175+ runs-on : ubuntu-latest
176+ timeout-minutes : 90
177+ environment : nightly-tests
178+ steps :
179+ - name : Checkout code
180+ uses : actions/checkout@v4
181+
182+ - name : Setup Go
183+ uses : actions/setup-go@v4
184+ with :
185+ go-version : ${{ env.GO_VERSION }}
186+
187+ - name : Setup Node.js
188+ uses : actions/setup-node@v4
189+ with :
190+ node-version : ${{ env.NODE_VERSION }}
191+
192+ - name : Login to Azure
193+ uses : azure/login@v1
194+ with :
195+ creds : ${{ secrets.AZURE_CREDENTIALS }}
196+
197+ - name : Install Pulumi CLI
198+ uses : pulumi/actions@v4
199+
200+ - name : Run Azure AKS tests
201+ run : make test-azure-aks
202+ env :
203+ PULUMI_ACCESS_TOKEN : ${{ secrets.PULUMI_ACCESS_TOKEN }}
204+ AZURE_CLIENT_ID : ${{ secrets.AZURE_CLIENT_ID }}
205+ AZURE_CLIENT_SECRET : ${{ secrets.AZURE_CLIENT_SECRET }}
206+ AZURE_TENANT_ID : ${{ secrets.AZURE_TENANT_ID }}
207+ AZURE_SUBSCRIPTION_ID : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
208+
209+ - name : Upload test results
210+ if : always()
211+ uses : actions/upload-artifact@v3
212+ with :
213+ name : azure-aks-test-results
214+ path : tests/test-results/
215+
216+ # Google GKE Tests
217+ test-gke :
218+ needs : setup
219+ if : contains(needs.setup.outputs.platforms, 'gke')
220+ runs-on : ubuntu-latest
221+ timeout-minutes : 90
222+ environment : nightly-tests
223+ steps :
224+ - name : Checkout code
225+ uses : actions/checkout@v4
226+
227+ - name : Setup Go
228+ uses : actions/setup-go@v4
229+ with :
230+ go-version : ${{ env.GO_VERSION }}
231+
232+ - name : Setup Node.js
233+ uses : actions/setup-node@v4
234+ with :
235+ node-version : ${{ env.NODE_VERSION }}
236+
237+ - name : Authenticate to Google Cloud
238+ uses : google-github-actions/auth@v1
239+ with :
240+ credentials_json : ${{ secrets.GOOGLE_CREDENTIALS }}
241+
242+ - name : Setup Google Cloud SDK
243+ uses : google-github-actions/setup-gcloud@v1
244+
245+ - name : Install Pulumi CLI
246+ uses : pulumi/actions@v4
247+
248+ - name : Run GKE tests
249+ run : make test-gke
250+ env :
251+ PULUMI_ACCESS_TOKEN : ${{ secrets.PULUMI_ACCESS_TOKEN }}
252+ GOOGLE_APPLICATION_CREDENTIALS : ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
253+ GOOGLE_PROJECT : ${{ secrets.GOOGLE_PROJECT }}
254+
255+ - name : Upload test results
256+ if : always()
257+ uses : actions/upload-artifact@v3
258+ with :
259+ name : gke-test-results
260+ path : tests/test-results/
261+
262+ # Collect and report results
263+ report-results :
264+ needs : [setup, test-aws-eks, test-aws-ecs-ts, test-aws-ecs-go, test-azure-aks, test-gke]
265+ if : always()
266+ runs-on : ubuntu-latest
267+ steps :
268+ - name : Download all test results
269+ uses : actions/download-artifact@v3
270+ with :
271+ path : test-results/
272+
273+ - name : Generate test report
274+ run : |
275+ echo "# Nightly Test Results - $(date)" > test-report.md
276+ echo "" >> test-report.md
277+
278+ # Check job results
279+ declare -A job_results
280+ job_results[aws-eks]="${{ needs.test-aws-eks.result }}"
281+ job_results[aws-ecs-ts]="${{ needs.test-aws-ecs-ts.result }}"
282+ job_results[aws-ecs-go]="${{ needs.test-aws-ecs-go.result }}"
283+ job_results[azure-aks]="${{ needs.test-azure-aks.result }}"
284+ job_results[gke]="${{ needs.test-gke.result }}"
285+
286+ echo "## Test Results Summary" >> test-report.md
287+ echo "" >> test-report.md
288+
289+ success_count=0
290+ total_count=0
291+
292+ for platform in "${!job_results[@]}"; do
293+ result="${job_results[$platform]}"
294+ total_count=$((total_count + 1))
295+
296+ if [[ "$result" == "success" ]]; then
297+ echo "✅ **$platform**: PASSED" >> test-report.md
298+ success_count=$((success_count + 1))
299+ elif [[ "$result" == "failure" ]]; then
300+ echo "❌ **$platform**: FAILED" >> test-report.md
301+ elif [[ "$result" == "skipped" ]]; then
302+ echo "⏭️ **$platform**: SKIPPED" >> test-report.md
303+ else
304+ echo "⚠️ **$platform**: $result" >> test-report.md
305+ fi
306+ done
307+
308+ echo "" >> test-report.md
309+ echo "**Overall Success Rate**: $success_count/$total_count platforms passed" >> test-report.md
310+
311+ # Show test report
312+ cat test-report.md
313+
314+ - name : Comment on commit (if failure)
315+ if : failure()
316+ uses : actions/github-script@v6
317+ with :
318+ script : |
319+ const fs = require('fs');
320+ const report = fs.readFileSync('test-report.md', 'utf8');
321+
322+ github.rest.repos.createCommitComment({
323+ owner: context.repo.owner,
324+ repo: context.repo.repo,
325+ commit_sha: context.sha,
326+ body: `🚨 **Nightly Test Failure**\n\n${report}`
327+ });
328+
329+ - name : Send Slack notification (if configured)
330+ if : always() && env.SLACK_WEBHOOK_URL != ''
331+ uses : 8398a7/action-slack@v3
332+ with :
333+ status : ${{ job.status }}
334+ text : |
335+ Nightly installer tests completed
336+ Results: ${{ needs.test-aws-eks.result }}, ${{ needs.test-aws-ecs-ts.result }}, ${{ needs.test-aws-ecs-go.result }}, ${{ needs.test-azure-aks.result }}, ${{ needs.test-gke.result }}
337+ env :
338+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
0 commit comments