From 4ec3f2bf664931fd15f53628ec7873adaaee9218 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Tue, 14 Mar 2023 13:52:43 +0000 Subject: [PATCH 1/2] Add a dummy benchmark. --- haskell-example.cabal | 15 +++++++++++++++ src/haskell-example-benchmark/Main.hs | 6 ++++++ 2 files changed, 21 insertions(+) create mode 100644 src/haskell-example-benchmark/Main.hs diff --git a/haskell-example.cabal b/haskell-example.cabal index 8f67b8e..e392c0f 100644 --- a/haskell-example.cabal +++ b/haskell-example.cabal @@ -74,3 +74,18 @@ test-suite haskell-example-test base >=4.7 && <5 , haskell-example , hspec + +benchmark haskell-example-benchmark + import: + common-extensions + default-language: + Haskell2010 + type: + exitcode-stdio-1.0 + hs-source-dirs: + src/haskell-example-benchmark + main-is: + Main.hs + build-depends: + base >=4.7 && <5 + , haskell-example diff --git a/src/haskell-example-benchmark/Main.hs b/src/haskell-example-benchmark/Main.hs new file mode 100644 index 0000000..7b59c38 --- /dev/null +++ b/src/haskell-example-benchmark/Main.hs @@ -0,0 +1,6 @@ +module Main where + +import Prelude + +main :: IO () +main = pure () From eca2812b5e622503f12a7cd437287b6c57c49873 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Tue, 14 Mar 2023 13:54:15 +0000 Subject: [PATCH 2/2] Add a "Benchmark" step to `build.yml`. --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae0cda5..9886c74 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -88,6 +88,12 @@ jobs: cabal test all --builddir=${{ env.cabal-build-dir }} + - name: Benchmark + run: > + cabal bench all + --builddir=${{ env.cabal-build-dir }} + || true + - name: Documentation (Generation) run: > cabal haddock