Skip to main content

Track build runtimes in every PR

The job runtime plugin automatically collects build times for every GitHub job and graphs them in the Stoat comment. Each line in the plot represents the runtime of a different workflow job across all the commits in the pull request. The x-axis is the short commit SHA, and the y-axis is the runtime in seconds.

The latest runtime from the default branch is shown at the beginning of the graph. They are marked by the gray area. Only the workflows that run before the pull request's first commit is shown. At most 10 runtime data points per workflow are included in each graph.

job runtime chart

How to enable tracking build runtimes

  1. Set up Stoat with our getting started guide.

  2. Make sure the Stoat Action appears at the end of each GitHub workflow job that you want to collect the runtime for:

    .github/workflows/hello-world.yaml
    name: Hello World

    on:
    push:

    jobs:
    build:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout
    uses: actions/checkout@v3

    # Append the stoat action at the end of each job you want to collect runtime for.
    - name: Run Stoat Action
    uses: stoat-dev/stoat-action@v0
    if: always()
  3. To enable tracking build runtimes, enable the job_runtime plugin in your .stoat/config.yaml file:

    .stoat/config.yaml
    ---
    version: 1
    enabled: true
    plugins:
    job_runtime:
    enabled: true
  4. That's it. Next time you create a pull request, you should see a line plot of action runtimes in the pinned comment.