Skip to content

Commit

Permalink
chore: add benchmarks (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhess authored May 2, 2024
2 parents 33ffda3 + 9af22ca commit 348a140
Show file tree
Hide file tree
Showing 5 changed files with 496 additions and 1 deletion.
64 changes: 64 additions & 0 deletions .github/workflows/benchmark-action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Benchmark regression checks

on:
workflow_dispatch:
push:

# NOTE: if you want to add a branch here other than `main`, please
# consider whether it will cause an unnecessary Nix build on a
# GitHub runner! See the note below.
branches:
- main

jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write
deployments: write

steps:
- name: Checkout repo
uses: actions/[email protected]
with:
# Required by flakes
fetch-depth: 0

- name: Install & configure Nix
uses: cachix/install-nix-action@v26
with:
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hackworthltd.cachix.org-1:0JTCI0qDo2J+tonOalrSQP3yRNleN6bQucJ05yDltRI= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk=
substituters = https://cache.nixos.org?priority=10 https://hackworthltd.cachix.org?priority=30 https://cache.iog.io?priority=40 https://cache.zw3rk.com?priority=50
# Note: if this Nix derivation hasn't been built yet, it will
# kick off a Nix build on a GitHub runner, which isn't ideal.
# However, because we use GitHub merge queues with this repo,
# and because this workflow is only configured to run
# automatically on pushes to `main`, we can be confident that
# it will already have been built and can be pulled from our
# Cachix cache without kicking off any builds.
- name: Fetch Nix benchmark results
run: |
nix build -L .#packages.x86_64-linux.gol-crate-bench
- name: Publish results
uses: benchmark-action/[email protected]
with:
name: gol benchmarks
tool: "cargo"
output-file-path: result/bench.txt
github-token: ${{ secrets.GITHUB_TOKEN }}

auto-push: true
gh-pages-branch: "gh-pages"
benchmark-data-dir-path: "dev/bench"

# Alert dhess if there's a regression.
alert-comment-cc-users: "@dhess"
alert-threshold: "200%"
comment-on-alert: true
fail-on-alert: false
Loading

0 comments on commit 348a140

Please sign in to comment.