Smoke #16
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: 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 | |
npm start & | |
# 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++ | |
} | |
} | |
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 > /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 | |
npm run dev:agent & | |
# 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" -TimeoutSec 1 -ErrorAction SilentlyContinue | |
if ($response.StatusCode -eq 200) { | |
$started = $true | |
Write-Host "✅ Agent started successfully" | |
} | |
} catch { | |
Start-Sleep -Seconds 1 | |
$elapsed++ | |
} | |
} | |
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/[email protected] | |
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>" | |
} | |
} | |
] | |
} | |