Skip to content

Add CI performance analysis script and workflow#8857

Open
tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig:ci-performance-analysis
Open

Add CI performance analysis script and workflow#8857
tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig:ci-performance-analysis

Conversation

@tautschnig
Copy link
Collaborator

@tautschnig tautschnig commented Mar 10, 2026

Add scripts/ci_analysis.py for automated analysis of GitHub Actions CI run durations. The script downloads logs via the gh CLI and produces detailed breakdowns at job, step, suite, and individual test levels.

Supported log formats:

  • ctest verbose output (CMake-based jobs)
  • make parallel output with runner-ID prefixes (Linux, macOS)
  • make serial output without prefixes (Windows VS 2022)
  • validate-trace-xml-schema timestamp-based output

Features:

  • Per-job wall-clock durations sorted by slowest first
  • Per-step durations within each job
  • Per-suite durations for both ctest and make test runners
  • Individual test drill-down within slow suites (>60s)
  • Cross-run aggregation with mean/min/max across N runs
  • Markdown output (--markdown) for GitHub Actions job summaries
  • Log caching to avoid re-downloading (--log-dir)
  • Workflow identified by filename for resilience to renames

Usage:
python3 scripts/ci_analysis.py # 5 recent runs
python3 scripts/ci_analysis.py --runs 10 --top 30
python3 scripts/ci_analysis.py --markdown # for CI summaries
python3 scripts/ci_analysis.py --log-dir /tmp/cache

A GitHub Actions workflow (.github/workflows/ci-analysis.yaml) runs the script on every push to develop and publishes the results as a job summary visible in the Actions tab.

See https://github.com/tautschnig/cbmc/actions/runs/23055870982 for an example of what the output looks like.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig tautschnig requested review from a team and peterschrammel as code owners March 10, 2026 10:57
Copilot AI review requested due to automatic review settings March 10, 2026 10:57
@tautschnig tautschnig self-assigned this Mar 10, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds automated CI performance analysis tooling: a Python script (scripts/ci_analysis.py) that downloads and parses GitHub Actions logs to report per-job, per-step, per-suite, and per-test durations, along with a workflow (.github/workflows/ci-analysis.yaml) that runs the script on every push to develop and publishes a Markdown job summary.

Changes:

  • New Python script (scripts/ci_analysis.py) that parses multiple CI log formats and produces performance breakdowns with optional Markdown output.
  • New GitHub Actions workflow (.github/workflows/ci-analysis.yaml) that triggers on pushes to develop and publishes the analysis as a job summary.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
scripts/ci_analysis.py Core analysis script with log downloading, parsing, aggregation, and output formatting
.github/workflows/ci-analysis.yaml Workflow definition that schedules and runs the analysis script
Comments suppressed due to low confidence (1)

scripts/ci_analysis.py:1

  • When --all-workflows is used, the gh run list call includes --workflow wf, but at this point wf is iterating over workflow names already fetched — passing --workflow will filter back to a single workflow, defeating the purpose of --all-workflows. The --workflow flag should be omitted when listing runs in the all-workflows branch, or the run listing should be done without it.
#!/usr/bin/env python3

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tautschnig tautschnig force-pushed the ci-performance-analysis branch from 78ff9e1 to 51e1ec7 Compare March 10, 2026 11:27
@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.01%. Comparing base (7a4df92) to head (3fee1c4).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8857   +/-   ##
========================================
  Coverage    80.01%   80.01%           
========================================
  Files         1703     1703           
  Lines       188396   188396           
  Branches        73       73           
========================================
+ Hits        150738   150741    +3     
+ Misses       37658    37655    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Add scripts/ci_analysis.py for automated analysis of GitHub Actions CI
run durations. The script downloads logs via the gh CLI and produces
detailed breakdowns at job, step, suite, and individual test levels.

Supported log formats:
- ctest verbose output (CMake-based jobs)
- make parallel output with runner-ID prefixes (Linux, macOS)
- make serial output without prefixes (Windows VS 2022)
- validate-trace-xml-schema timestamp-based output

Features:
- Per-job wall-clock durations sorted by slowest first
- Per-step durations within each job
- Per-suite durations for both ctest and make test runners
- Individual test drill-down within slow suites (>60s)
- Cross-run aggregation with mean/min/max across N runs
- Markdown output (--markdown) for GitHub Actions job summaries
- Log caching to avoid re-downloading (--log-dir)
- Workflow identified by filename for resilience to renames

Usage:
  python3 scripts/ci_analysis.py                    # 5 recent runs
  python3 scripts/ci_analysis.py --runs 10 --top 30
  python3 scripts/ci_analysis.py --markdown         # for CI summaries
  python3 scripts/ci_analysis.py --log-dir /tmp/cache

A GitHub Actions workflow (.github/workflows/ci-analysis.yaml) runs the
script on every push to develop and publishes the results as a job
summary visible in the Actions tab.

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
@tautschnig tautschnig force-pushed the ci-performance-analysis branch from 51e1ec7 to 3fee1c4 Compare March 13, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants