Skip to content

Watch build time in CI ​

Buildray is available on the GitHub Marketplace.

The GitHub Action compares a pull request with its base revision. It builds and tests both, then alternates their full-build measurements on the same runner.

Add the workflow ​

Create .github/workflows/build-time.yml in your project:

yaml
name: Build time
on: [pull_request]
permissions:
  contents: read
jobs:
  buildray:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0
      - uses: kennethassogba/buildray@v0.13.0
        with:
          source: .
          cmake-args: '["-DBUILD_TESTING=ON"]'
          runs: '5'
          jobs: '2'
          max-regression-percent: '5'

The example uses a versioned release. Pin its full commit SHA if you require immutable dependencies. Adjust the project's CMake test option. The Action installs its tools on Ubuntu 24.04 and builds the CLI; preparation is outside the compared timings. It also works directly from the repository.

Find the results ​

The job summary shows the comparison. Artifacts retain reports and, for optimization experiments, the patch. Retention defaults to 30 days. The gate fails when a slowdown exceeds the budget and noise threshold.

The Action does not apply patches or open PRs. Sources and tests execute project code; use the same trust boundaries as a normal build workflow.

Relative symlinks inside the copied source tree are supported. Absolute links, broken links and links outside the copy are rejected.

Evaluate another repository ​

In Buildray's Actions → Evaluate a repository → Run workflow, enter a public repository, revision and CMake test options. Choose clean-deps, clean or measure. No fork or new workflow file is needed. Reports, tests, any patch and the exact source revisions are saved as artifacts.

For dependency cleanup, add rebuild_files, for example ["src/model.cc"], to measure rebuilds after editing those files. This skips repeated clean-build timings, while still building and testing both complete variants. Use an empty list to measure clean builds. Three pairs are the default; no speedup is claimed when results are inconclusive.

Try an optimization ​

For example, add these inputs to the Buildray step's with block:

yaml
command: clean-deps
runs: '3'
jobs: '2'

command: clean removes unused includes; command: clean-deps searches unused private static-library links and selects LLD automatically. The old command names still work.

Optimization experiments compare the project with its patched copy. They ignore baseline-ref, which is used for revision comparisons.

PCH is disabled by default. It requires an explicit command: pch; include and dependency cleanup do not enable it.

For a project with intentional runtime skips, allow-baseline-skips: 'true' permits the same skipped tests throughout validation. They are reported separately from passing tests. The default refuses all skips.

The automatic revision comparison exports the base with git archive. It does not materialize Git submodules or LFS contents. If your project needs them, prepare both source trees and use the native compare command in your workflow.

See the Action inputs and outputs and technical CI guide for other modes and limitations.