From c4197e99bbe0d38cd817acb2661f698681934f5a Mon Sep 17 00:00:00 2001 From: Xiaoyu Zhang <35585791+BBuf@users.noreply.github.com> Date: Fri, 26 Sep 2025 10:29:47 +0800 Subject: [PATCH] [ci] add ci-monitor workflow (#10898) --- .github/workflows/ci-monitor.yml | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/ci-monitor.yml diff --git a/.github/workflows/ci-monitor.yml b/.github/workflows/ci-monitor.yml new file mode 100644 index 000000000..2641c03f1 --- /dev/null +++ b/.github/workflows/ci-monitor.yml @@ -0,0 +1,53 @@ +name: CI Monitor + +on: + schedule: + # Run every 6 hours at 00:00, 06:00, 12:00, 18:00 UTC + - cron: '0 */6 * * *' + pull_request: + branches: [ main ] + workflow_dispatch: + inputs: + limit: + description: 'Number of CI runs to analyze' + required: false + default: '1000' + type: string + +concurrency: + group: ci-monitor-${{ github.ref }} + cancel-in-progress: true + +jobs: + ci-monitor: + 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.9' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install requests + + - name: Run CI Analysis + env: + GITHUB_TOKEN: ${{ secrets.GH_PAT_FOR_NIGHTLY_CI }} + PYTHONUNBUFFERED: 1 + PYTHONIOENCODING: utf-8 + run: | + cd scripts/ci_monitor + python ci_analyzer.py --token $GITHUB_TOKEN --limit ${{ github.event.inputs.limit || '1000' }} --output ci_analysis_$(date +%Y%m%d_%H%M%S).json + + - name: Upload Analysis Results + uses: actions/upload-artifact@v4 + with: + name: ci-analysis-results-${{ github.run_number }} + path: scripts/ci_monitor/ci_analysis_*.json + retention-days: 30