Skip to content

Commit 4da51b6

Browse files
committed
Update CI to run and export benchmarks across several GHC versions
1 parent 50ac7be commit 4da51b6

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,20 @@ jobs:
3737
- name: Build
3838
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal build --allow-newer --disable-tests --disable-benchmarks"
3939
- name: Haddock
40-
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal --allow-newer haddock"
40+
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal haddock --allow-newer"
4141
- name: cabal-docspec
42-
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run cabal-docspec
42+
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal-docspec"
43+
- name: Build benchmarks
44+
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal build linear-base:bench:bench --allow-newer"
45+
- name: Run benchmarks
46+
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal bench --allow-newer 2>&1 | tee benchmark_ghc${{ matrix.ghc-version }}.txt"
47+
- name: Upload benchmark results
48+
uses: actions/upload-artifact@v3
49+
with:
50+
name: linear-base_benchmarks_ghc${{ matrix.ghc-version }}
51+
path: |
52+
benchmark_ghc${{ matrix.ghc-version }}.txt
53+
retention-days: 365
4354

4455
ormolu:
4556
name: check formatting with ormolu

cabal.project

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
packages: *.cabal
2+
3+
-- We need the `--alloc-newer` flag on cabal invocations because otherwise a build plan cannot be found.
4+
-- But as of 2024-09-11, the latest version of the `unix` 2.8.5.1 package has a conditional bound on `filepath` depending on the `os-string` flag (see https://hackage.haskell.org/package/unix-2.8.5.1/dependencies).
5+
-- With no extra parameter or setting, we get a dependency conflict on `filepath`, as other libs use a version of `filepath` incompatible with the one `unix` wants.
6+
-- Setting `filepath` to 1.4.2.2 fixes that.
7+
constraints: filepath ==1.4.2.2

linear-base.cabal

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ common build-opts
2626
-- Additional warnings we may consider adding:
2727
-- * -Wredundant-constraints : would need deactivating in the modules which use Nat
2828
common rts-opts-multithread
29-
ghc-options: -threaded -rtsopts -with-rtsopts=-N
30-
common rts-opts-monothread
31-
ghc-options: -threaded -rtsopts -with-rtsopts=-N1
29+
ghc-options: -threaded -rtsopts "-with-rtsopts=-N"
30+
common rts-opts-monothread-stats
31+
ghc-options: -threaded -rtsopts "-with-rtsopts=-N1 -T"
3232

3333
library
3434
import: build-opts
@@ -212,7 +212,7 @@ test-suite test-examples
212212

213213
benchmark bench
214214
import: build-opts
215-
import: rts-opts-monothread
215+
import: rts-opts-monothread-stats
216216
type: exitcode-stdio-1.0
217217
main-is: Main.hs
218218
hs-source-dirs: bench

0 commit comments

Comments
 (0)