Skip to content
Latchkey

Micro Benchmark Runs workflow (jekyll/jekyll)

The Micro Benchmark Runs workflow from jekyll/jekyll, explained and optimized by Latchkey.

B

CI health: B - good

Run this on Latchkey for self-healing, caching, and up to 58% lower cost.

Grade your own workflow free or run it on Latchkey →
Source: jekyll/jekyll.github/workflows/benchmark.ymlLicense MITView source

What it does

This is the Micro Benchmark Runs workflow from the jekyll/jekyll repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: Micro Benchmark Runs

on:
  workflow_dispatch:
    inputs:
      path:
        description: "Path to benchmark script relative to 'benchmark' directory."
        required: true
        default: "capture-assign.rb"
      ruby_version:
        description: "Ruby version to use (via `ruby/setup-ruby@v1`) action."
        required: false
        default: "2.7"

jobs:
  benchmark:
    name: "Benchmark (${{ github.event.inputs.path }}) (Ruby ${{ github.event.inputs.ruby_version }})"
    runs-on: "ubuntu-latest"
    env:
      BENCHMARK: true
    steps:
    - name: Checkout Jekyll
      uses: actions/checkout@v4
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ github.event.inputs.ruby_version }}
        bundler-cache: true
    - name: Run Benchmark
      run: "bundle exec ruby benchmark/${{ github.event.inputs.path }}"

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: Micro Benchmark Runs
 
on:
  workflow_dispatch:
    inputs:
      path:
        description: "Path to benchmark script relative to 'benchmark' directory."
        required: true
        default: "capture-assign.rb"
      ruby_version:
        description: "Ruby version to use (via `ruby/setup-ruby@v1`) action."
        required: false
        default: "2.7"
 
jobs:
  benchmark:
    timeout-minutes: 30
    name: "Benchmark (${{ github.event.inputs.path }}) (Ruby ${{ github.event.inputs.ruby_version }})"
    runs-on: "ubuntu-latest"
    env:
      BENCHMARK: true
    steps:
    - name: Checkout Jekyll
      uses: actions/checkout@v4
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ github.event.inputs.ruby_version }}
        bundler-cache: true
    - name: Run Benchmark
      run: "bundle exec ruby benchmark/${{ github.event.inputs.path }}"
 

What changed

1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow