Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.43 KB

File metadata and controls

43 lines (30 loc) · 1.43 KB

Cabal example for benchmarking with criterion

This directory shows how to use github-action-benchmark with criterion package.

You can see a quick criterion tutorial here.

NB: As for now, this GitHub action only supports benchmarks made with criterion package outputted as a .csv file.

Run benchmarks

If the file with the benchmarks is also a "benchmark" according to your .cabal file, then

- name: Run benchmark
  run: cabal bench --benchmark-options="--csv <FILENAME>"

should do the trick. If it is an "executable" (as it is in the example), then run it with

- name: Run benchmark
  run: cabal run -- --csv <FILENAME>"

Process benchmark results

Store the benchmark results with step using the action.

- name: Store benchmark result
  uses: benchmark-action/github-action-benchmark@v1
  with:
    tool: 'cabal'
    output-file-path: <FILENAME>

Please read 'How to use' section for common usage.