Skip to content

netlify/delta-action

Repository files navigation

Delta Action

A GitHub Action for reporting benchmark data and comparing it against a baseline.

Screenshot of a benchmark report comment

The basics

This action reads benchmark metrics on GitHub pull requests and commits, and reports them by adding a comment with any metrics found. It also compares then against the latest commit on the main branch, treating it as the baseline.

The action looks for benchmark data in files on the repository root. These should be named in the format .delta.<metric name> — e.g. .delta.install_time will create a metric called install_time.

These files should contain:

  • A number representing the value of the metric
  • The units of the metric (optional)
  • A human-friendly name of the metric (optional)

Example: .delta.install_time

350ms (Installation time)

The units will determine how the values will be formatted in the benchmark reports. Supported units are:

Configuration

The action supports the following optional inputs:

Name Description Default
base_branch Name of the base branch, if not auto detected autodetect
title Title/heading to include in the comments Delta results
token GitHub access token GITHUB_TOKEN
pr_number The PR this run is associated with (for workflow_run) autodetect
style The rendering style to use when commenting on PRs (options: text, graph) graph

Usage

  1. Add a benchmark step to your workflow that creates a .delta.<metric> file with the format described above
- name: Run benchmark
  run: echo 123ms > .delta.install_time
  1. Add the action to the workflow

    - name: Delta
      uses: netlify/delta-action@v3
      with:
        token: ${{ secrets.GITHUB_TOKEN }}

Contributors

Please see CONTRIBUTING.md for instructions on how to set up and work on this repository. Thanks for contributing!

About

A GitHub Action for capturing benchmark data and tracking its variation against a baseline

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published