Skip to content

Commit f0ac6b9

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

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Continuous integration
22
on: [push, pull_request]
33
env:
44
# Bump this number to invalidate the Github-actions cache
5-
cache-invalidation-key: 0
5+
cache-invalidation-key: 1
66
nixpkgs-url: https://github.com/NixOS/nixpkgs/archive/574d1eac1c200690e27b8eb4e24887f8df7ac27c.tar.gz
77

88
jobs:
@@ -33,13 +33,24 @@ jobs:
3333
- name: Update Cabal's database
3434
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal update"
3535
- name: Build Cabal's dependencies
36-
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal build --allow-newer --disable-tests --disable-benchmarks --dependencies-only"
36+
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal build --disable-tests --disable-benchmarks --dependencies-only"
3737
- name: Build
38-
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal build --allow-newer --disable-tests --disable-benchmarks"
38+
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal build --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"
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"
45+
- name: Run benchmarks
46+
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --arg installHls 'false' --pure --run "cabal bench 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

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)