-
Notifications
You must be signed in to change notification settings - Fork 17
97 lines (89 loc) · 3.08 KB
/
prod-chat-regression.yml
File metadata and controls
97 lines (89 loc) · 3.08 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
name: Production Chat Regression
on:
workflow_call:
inputs:
base_url:
description: "Production API base URL"
required: false
default: "https://www.aidcmo.com/api/v1"
type: string
project_id:
description: "Project ID used for chat regression"
required: false
default: "36"
type: string
locale:
description: "Locale for generated content"
required: false
default: "zh"
type: string
workflow_dispatch:
inputs:
base_url:
description: "Production API base URL"
required: true
default: "https://www.aidcmo.com/api/v1"
project_id:
description: "Project ID used for chat regression"
required: true
default: "36"
locale:
description: "Locale for generated content"
required: true
default: "zh"
schedule:
- cron: "30 3 * * *"
concurrency:
group: prod-chat-regression
cancel-in-progress: false
jobs:
regression:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
DEFAULT_BASE_URL: https://www.aidcmo.com/api/v1
DEFAULT_PROJECT_ID: "36"
DEFAULT_LOCALE: zh
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install -e . requests
- name: Run production platform regression
env:
BASE_URL: ${{ inputs.base_url || github.event.inputs.base_url || env.DEFAULT_BASE_URL }}
PROJECT_ID: ${{ inputs.project_id || github.event.inputs.project_id || env.DEFAULT_PROJECT_ID }}
LOCALE: ${{ inputs.locale || github.event.inputs.locale || env.DEFAULT_LOCALE }}
run: |
python -m opencmo.ops.chat_platform_regression \
--base-url "$BASE_URL" \
--project-id "$PROJECT_ID" \
--locale "$LOCALE" \
--json \
--fail-on-incomplete | tee prod-chat-regression.jsonl
- name: Build workflow summary
run: |
python - <<'PY'
import json
from pathlib import Path
path = Path("prod-chat-regression.jsonl")
rows = [json.loads(line) for line in path.read_text().splitlines() if line.strip()]
with Path.cwd().joinpath("summary.md").open("w", encoding="utf-8") as fh:
fh.write("## Production Chat Regression\n\n")
fh.write("| Platform | Agent | Done | Timeout | Error |\n")
fh.write("| --- | --- | --- | --- | --- |\n")
for row in rows:
error = (row.get("error") or "").replace("\n", " ")[:120]
fh.write(
f"| {row['platform']} | {row.get('agent') or ''} | {row['done']} | "
f"{row.get('stream_timed_out')} | {error} |\n"
)
PY
cat summary.md >> "$GITHUB_STEP_SUMMARY"
- name: Upload regression artifact
uses: actions/upload-artifact@v4
with:
name: prod-chat-regression
path: prod-chat-regression.jsonl