This repository was archived by the owner on Mar 12, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
195 lines (166 loc) · 5.84 KB
/
smoke.yml
File metadata and controls
195 lines (166 loc) · 5.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: Smoke
on:
push:
branches: main
pull_request:
branches: main
schedule:
- cron: '0 0 * * *' # Run daily at midnight UTC
jobs:
smoke:
name: ${{ matrix.os }} / Node ${{ matrix.node }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node: [20, 22]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies (root)
run: npm install
- name: Build
run: npm run build
- name: Start and check main app (Linux/macOS)
if: runner.os != 'Windows'
run: |
# Start the server in background
npm start &
SERVER_PID=$!
# Wait for server to start (max 30 seconds)
timeout=30
elapsed=0
started=false
while [ $elapsed -lt $timeout ] && [ "$started" = false ]; do
if curl -s http://localhost:3000 > /dev/null 2>&1; then
started=true
echo "✅ Main app started successfully"
else
sleep 1
elapsed=$((elapsed + 1))
fi
done
# Clean up background process
kill $SERVER_PID 2>/dev/null || true
if [ "$started" = false ]; then
echo "❌ Main app failed to start within 30 seconds"
exit 1
fi
shell: bash
- name: Start and check main app (Windows)
if: runner.os == 'Windows'
run: |
# Start the server in background and capture PID
Start-Job -ScriptBlock { npm start } -Name "MainAppJob"
# Wait for server to start (max 30 seconds)
$timeout = 30
$elapsed = 0
$started = $false
while ($elapsed -lt $timeout -and -not $started) {
try {
$response = Invoke-WebRequest -Uri "http://localhost:3000" -TimeoutSec 1 -ErrorAction SilentlyContinue
if ($response.StatusCode -eq 200) {
$started = $true
Write-Host "✅ Main app started successfully"
}
} catch {
Start-Sleep -Seconds 1
$elapsed++
}
}
# Clean up background job
Get-Job -Name "MainAppJob" | Stop-Job -PassThru | Remove-Job
if (-not $started) {
Write-Host "❌ Main app failed to start within 30 seconds"
exit 1
}
shell: pwsh
- name: Test agent functionality (Linux/macOS)
if: runner.os != 'Windows'
run: |
# Test that the agent can be started and responds
echo "Testing agent functionality..."
# Start the agent in background
npm run dev:agent &
AGENT_PID=$!
# Wait for agent to start (max 30 seconds)
timeout=30
elapsed=0
started=false
while [ $elapsed -lt $timeout ] && [ "$started" = false ]; do
if curl -s http://localhost:4111/api > /dev/null 2>&1; then
started=true
echo "✅ Agent started successfully"
else
sleep 1
elapsed=$((elapsed + 1))
fi
done
# Clean up background process
kill $AGENT_PID 2>/dev/null || true
if [ "$started" = false ]; then
echo "❌ Agent failed to start within 30 seconds"
exit 1
fi
shell: bash
- name: Test agent functionality (Windows)
if: runner.os == 'Windows'
run: |
# Test that the agent can be started and responds
Write-Host "Testing agent functionality..."
# Start the agent in background and capture PID
Start-Job -ScriptBlock { npm run dev:agent } -Name "AgentJob"
# Wait for agent to start (max 30 seconds)
$timeout = 30
$elapsed = 0
$started = $false
while ($elapsed -lt $timeout -and -not $started) {
try {
$response = Invoke-WebRequest -Uri "http://localhost:4111/api" -TimeoutSec 1 -ErrorAction SilentlyContinue
if ($response.StatusCode -eq 200) {
$started = $true
Write-Host "✅ Agent started successfully"
}
} catch {
Start-Sleep -Seconds 1
$elapsed++
}
}
# Clean up background job
Get-Job -Name "AgentJob" | Stop-Job -PassThru | Remove-Job
if (-not $started) {
Write-Host "❌ Agent failed to start within 30 seconds"
exit 1
}
shell: pwsh
notify-slack:
name: Notify Slack on Failure
runs-on: ubuntu-latest
needs: smoke
if: |
failure() &&
github.event_name == 'schedule'
steps:
- name: Notify Slack
uses: slackapi/slack-github-action@v2.1.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"text": ":warning: *Smoke test failed for `with-mastra` :warning:.*",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":warning: *Smoke test failed for <https://github.com/copilotkit/with-mastra|with-mastra> :warning:*\n\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View run details>"
}
}
]
}