65 lines
1.7 KiB
YAML
65 lines
1.7 KiB
YAML
name: CI Failure Monitor
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '*/30 * * * *' # Every 30 minutes
|
|
workflow_dispatch:
|
|
inputs:
|
|
limit:
|
|
description: 'Number of workflow runs to analyze (across all workflows)'
|
|
required: false
|
|
default: '800'
|
|
type: string
|
|
threshold:
|
|
description: 'Alert threshold for consecutive failures'
|
|
required: false
|
|
default: '4'
|
|
type: string
|
|
|
|
concurrency:
|
|
group: ci-failure-monitor-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
actions: read
|
|
|
|
jobs:
|
|
failure-analysis:
|
|
if: github.repository == 'sgl-project/sglang' || github.event_name == 'pull_request'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.14'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install requests
|
|
|
|
- name: Run Failure Analysis
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GH_PAT_FOR_NIGHTLY_CI_DATA }}
|
|
PYTHONUNBUFFERED: 1
|
|
PYTHONIOENCODING: utf-8
|
|
run: |
|
|
cd scripts/ci_monitor
|
|
python ci_failures_analysis.py \
|
|
--token $GITHUB_TOKEN \
|
|
--limit ${{ inputs.limit || '800' }} \
|
|
--threshold ${{ inputs.threshold || '4' }} \
|
|
--output ci_failure_analysis_$(date +%Y%m%d_%H%M%S).json
|
|
|
|
- name: Upload Analysis Results
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ci-failure-analysis-${{ github.run_number }}
|
|
path: |
|
|
scripts/ci_monitor/ci_failure_analysis_*.json
|
|
retention-days: 7
|