aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-02-22 21:36:19 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2021-02-22 21:36:31 -0800
commit56a6478a408d8199ec13425ed7a3adc78613c6bb (patch)
treed9b2c3664297a06589e052724172be0297fd8bf2 /.github
parentf0a991a22be9b82e192d63bf80bbe39679bb2e07 (diff)
downloadpandoc-56a6478a408d8199ec13425ed7a3adc78613c6bb.tar.gz
Add linux benchmark to CI.
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci.yml56
1 files changed, 56 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 30a0a025a..10ff8dcf8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -192,3 +192,59 @@ jobs:
# fail if warnings in local build
! grep -q ": *[Ww]arning:" build.log || exit 1
cabal v2-test --disable-optimization
+
+ linux/benchmark:
+
+ runs-on: ubuntu-18.04
+ strategy:
+ fail-fast: true
+ matrix:
+ versions:
+ - ghc: '8.8.4'
+ cabal: '3.2'
+ - ghc: '8.10.2'
+ cabal: '3.2'
+ steps:
+ - uses: actions/checkout@v2
+
+ # need to install older cabal/ghc versions from ppa repository
+
+ - name: Install recent cabal/ghc
+ uses: haskell/actions/setup@v1
+ with:
+ ghc-version: ${{ matrix.versions.ghc }}
+ cabal-version: ${{ matrix.versions.cabal }}
+
+ # declare/restore cached things
+ # caching doesn't work for scheduled runs yet
+ # https://github.com/actions/cache/issues/63
+
+ - name: Cache cabal global package db
+ id: cabal-global
+ uses: actions/cache@v2
+ with:
+ path: |
+ ~/.cabal
+ key: ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-global-${{ hashFiles('cabal.project') }}
+
+ - name: Cache cabal work
+ id: cabal-local
+ uses: actions/cache@v2
+ with:
+ path: |
+ dist-newstyle
+ key: ${{ runner.os }}-${{ matrix.versions.ghc }}-${{ matrix.versions.cabal }}-cabal-local
+
+ - name: Install dependencies
+ run: |
+ v2=$([ "${{ matrix.versions.cabal }}" = "2.2" ] && printf 'new' || printf 'v2')
+ cabal $v2-update
+ cabal $v2-build --dependencies-only --enable-optimization=1 --enable-benchmarks
+
+ - name: Build and test
+ run: |
+ v2=$([ "${{ matrix.versions.cabal }}" = "2.2" ] && printf 'new' || printf 'v2')
+ cabal $v2-build --enable-optimization=1 --enable-benchmarks 2>&1 | tee build.log
+ # fail if warnings in local build
+ ! grep -q ": *[Ww]arning:" build.log || exit 1
+ cabal $v2-bench --enable-optimization=1