Skip to content

build(deps): bump actions/setup-node from 4 to 6 #227

build(deps): bump actions/setup-node from 4 to 6

build(deps): bump actions/setup-node from 4 to 6 #227

Workflow file for this run

name: Benchmarks
on:
pull_request:
types:
- labeled
env:
OCAML_VERSION: "4.14.2"
RUST_TOOLCHAIN_VERSION: "1.92"
jobs:
bench:
runs-on: ubuntu-latest
name: Run benchmarks
if: github.event.label.name == 'benchmark'
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Use shared Rust toolchain setting up steps
uses: ./.github/actions/toolchain-shared
with:
rust_toolchain_version: ${{ env.RUST_TOOLCHAIN_VERSION }}
- name: Install dependencies
run: |
set -x
cargo install cargo-criterion
- name: Use shared OCaml setting up steps
uses: ./.github/actions/ocaml-shared
with:
ocaml_version: ${{ env.OCAML_VERSION }}
# - name: Run iai bench
# run: |
# set -x
# cargo bench -p kimchi --bench proof_iai > iai_bench
# cat iai_bench
- name: Run criterion bench
run: |
set -x
eval $(opam env)
cargo criterion -p kimchi --bench proof_criterion --color never > criterion_bench 2>&1
cat criterion_bench
- name: Write result in PR
uses: actions/github-script@v8
with:
script: |
const fs = require('fs');
// read the output file
// const iai_bench = fs.readFileSync("iai_bench", {encoding:'utf8', flag:'r'});
const criterion_bench = fs.readFileSync("criterion_bench", {encoding:'utf8', flag:'r'});
// form message
const message = `Hello there👋
Here are some benchmark results using [criterion](https://bheisler.github.io/criterion.rs/). Keep in mind that since this runs in CI, it is not really accurate (as it depends on the host load)
<pre><code>${criterion_bench}</code></pre>`;
/*
const iai = `Here's some more accurate benchmark with [iai](https://github.com/bheisler/iai)
<pre><code>${iai_bench}</code></pre>`;
*/
// post comment
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: message
})