Files
awoooi/.github/workflows/daily-e2e-health.yaml
OG T 12f7a83df8 fix(ci): 修復 Runner _diag/pages 檔案衝突 (徹底解決)
根本原因:
- 41 個殭屍 Runner 進程互相衝突
- _diag/pages 目錄沒有自動清理

解決方案:
- 所有 Workflow Job 第一步清理 _diag/pages
- 覆蓋所有 self-hosted runner jobs

影響範圍:
- runner-healthcheck.yml (2 jobs)
- daily-e2e-health.yaml (1 job)
- nightly-llm.yaml (1 job)
- ci.yaml (9 jobs)
- cd.yaml (已有)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-29 15:09:13 +08:00

120 lines
3.9 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# =============================================================================
# AWOOOI Daily E2E Health Check (Phase 18.3)
# =============================================================================
# 🎯 每日端到端驗證Alert → AI → Approval → Execution
#
# 觸發時機:
# - 每日 00:30 UTC (08:30 台北)
# - 手動觸發
#
# 驗證內容:
# - E2E Tool Call 完整流程
# - Safe Mode 防護機制
# - 目標資源驗證
#
# 失敗通知: Telegram
name: Daily E2E Health Check
on:
schedule:
- cron: '30 0 * * *' # 每日 00:30 UTC (08:30 台北)
workflow_dispatch:
inputs:
api_url:
description: 'API URL to test'
required: false
default: 'http://192.168.0.125:32334'
dry_run:
description: 'Dry run mode (skip actual approval)'
required: false
default: 'true'
type: choice
options:
- 'true'
- 'false'
concurrency:
group: daily-e2e
cancel-in-progress: true
env:
PYTHON_VERSION: '3.11'
DEFAULT_API_URL: http://192.168.0.125:32334
jobs:
e2e-health-check:
name: E2E Health Check
runs-on: [self-hosted, harbor, k8s]
timeout-minutes: 15
steps:
# 2026-03-29 Claude Code: 修復 _diag/pages 檔案衝突
- name: "Clean Runner Diagnostics"
run: |
RUNNER_ROOT=$(dirname "$(dirname "$RUNNER_TEMP")")
rm -rf "$RUNNER_ROOT/_diag/pages" 2>/dev/null || true
mkdir -p "$RUNNER_ROOT/_diag/pages" 2>/dev/null || true
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install dependencies
working-directory: apps/api
run: uv sync
- name: Check API Health
run: |
API_URL="${{ github.event.inputs.api_url || env.DEFAULT_API_URL }}"
echo "🔗 檢查 API 健康狀態..."
if curl -s --connect-timeout 10 "$API_URL/health" > /dev/null; then
echo "✅ API 可用: $API_URL"
else
echo "❌ API 無法連線: $API_URL"
exit 1
fi
- name: Run E2E Verification
id: e2e
working-directory: apps/api
env:
PYTHONPATH: ${{ github.workspace }}/apps/api
run: |
API_URL="${{ github.event.inputs.api_url || env.DEFAULT_API_URL }}"
DRY_RUN="${{ github.event.inputs.dry_run || 'true' }}"
echo "🎯 執行 E2E Tool Call Verification v2.0"
echo " API: $API_URL"
echo " Dry Run: $DRY_RUN"
if [ "$DRY_RUN" = "true" ]; then
uv run python -m scripts.e2e_tool_call_verification --api-url "$API_URL" --dry-run
else
uv run python -m scripts.e2e_tool_call_verification --api-url "$API_URL" --no-dry-run
fi
- name: Summary
if: always()
run: |
echo "## Daily E2E Health Check 完成" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| 項目 | 值 |" >> $GITHUB_STEP_SUMMARY
echo "|------|-----|" >> $GITHUB_STEP_SUMMARY
echo "| API URL | ${{ github.event.inputs.api_url || env.DEFAULT_API_URL }} |" >> $GITHUB_STEP_SUMMARY
echo "| 時間 | $(TZ='Asia/Taipei' date '+%Y-%m-%d %H:%M:%S') |" >> $GITHUB_STEP_SUMMARY
echo "| 結果 | ${{ steps.e2e.outcome }} |" >> $GITHUB_STEP_SUMMARY
# Phase 18.3.2: 失敗時 Telegram 通知
- name: Notify on Failure
if: failure()
run: |
curl -s -X POST "https://api.telegram.org/bot${{ secrets.OPENCLAW_TG_BOT_TOKEN }}/sendMessage" \
-d "chat_id=${{ secrets.OPENCLAW_TG_CHAT_ID }}" \
-d "text=❌ Daily E2E Health Check 失敗%0A時間: $(TZ='Asia/Taipei' date '+%Y-%m-%d %H:%M')%0A詳情: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"