mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
1fd938ac35
New workflow running starter health/agent/chat tests against Railway: - Triggers: 6h cron, after showcase deploy, manual dispatch - Alerts on schedule + workflow_run failures (Slack + GitHub issue) - Issue dedup by title match, continue-on-error on Slack - Proper working-directory for npm ci and Playwright install
91 lines
3.1 KiB
YAML
91 lines
3.1 KiB
YAML
name: Starter Deployed Smoke Tests
|
|
|
|
on:
|
|
schedule:
|
|
# Every 6 hours — primary safety net for deployed starters
|
|
- cron: "0 */6 * * *"
|
|
workflow_run:
|
|
workflows: ["Showcase: Build & Deploy"]
|
|
types: [completed]
|
|
workflow_dispatch:
|
|
inputs:
|
|
starter_slug:
|
|
description: "Optional: test a single starter slug"
|
|
required: false
|
|
type: string
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: read
|
|
issues: write
|
|
|
|
jobs:
|
|
starter-deployed-smoke:
|
|
runs-on: ubuntu-latest
|
|
if: >-
|
|
github.event_name != 'workflow_run' ||
|
|
github.event.workflow_run.conclusion == 'success'
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
lfs: false
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Install test dependencies
|
|
run: npm ci
|
|
working-directory: showcase/tests
|
|
|
|
- name: Install Playwright
|
|
working-directory: showcase/tests
|
|
run: npx playwright install chromium --with-deps
|
|
|
|
- name: Run starter deployed smoke tests
|
|
working-directory: showcase/tests
|
|
run: npx playwright test e2e/integration-smoke.spec.ts --grep "@starter-health|@starter-agent|@starter-chat"
|
|
env:
|
|
STARTER_SLUG: ${{ inputs.starter_slug || '' }}
|
|
|
|
- name: Build Slack payload
|
|
if: failure() && (github.event_name == 'schedule' || github.event_name == 'workflow_run')
|
|
run: |
|
|
URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
jq -n --arg text ":rotating_light: *Starter Deployed Smoke Test Failed*\n<$URL|View run>" \
|
|
'{text: $text}' > /tmp/slack-payload.json
|
|
|
|
- name: Alert Slack on failure
|
|
if: failure() && (github.event_name == 'schedule' || github.event_name == 'workflow_run')
|
|
uses: slackapi/slack-github-action@v2.1.0
|
|
continue-on-error: true
|
|
with:
|
|
webhook: ${{ secrets.SLACK_WEBHOOK_OSS_ALERTS }}
|
|
webhook-type: incoming-webhook
|
|
payload-file-path: /tmp/slack-payload.json
|
|
|
|
- name: Create GitHub issue on failure
|
|
if: failure() && (github.event_name == 'schedule' || github.event_name == 'workflow_run')
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
const title = `Starter deployed smoke test failure - ${new Date().toISOString().split('T')[0]}`;
|
|
const { data: issues } = await github.rest.issues.listForRepo({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
labels: 'starter-health',
|
|
state: 'open',
|
|
});
|
|
const existing = issues.find(i => i.title === title);
|
|
if (!existing) {
|
|
await github.rest.issues.create({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
title,
|
|
labels: ['starter-health'],
|
|
body: `Automated starter deployed smoke test failed.\n\n[View run](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId})`,
|
|
});
|
|
}
|