Skip to content

Merge pull request #296 from thielema/reactive-banana-1.3 #248

Merge pull request #296 from thielema/reactive-banana-1.3

Merge pull request #296 from thielema/reactive-banana-1.3 #248

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: [master]
jobs:
build:
name: ghc ${{matrix.ghc}}
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.allow-failure }}
strategy:
fail-fast: false
matrix:
include:
- ghc: '9.8.1'
allow-failure: true
- ghc: '9.6.3'
allow-failure: false
- ghc: '9.4.8 '
allow-failure: false
- ghc: '9.2.8'
allow-failure: false
- ghc: '8.10.7'
allow-failure: false
- ghc: '8.8.4'
allow-failure: false
- ghc: '8.6.5'
allow-failure: false
- ghc: '8.4.4'
allow-failure: false
steps:
# Weird, the action runner fails with a 'missing -lnuma' error, but only on 8.4.4.
- name: Install libnuma-dev for ghc 8.4.4
if: matrix.ghc == '8.4.4'
run: sudo apt-get install libnuma-dev
- uses: actions/checkout@v2
- uses: actions/cache@v2
id: cache-ghc
name: Cache GHC
with:
path: ~/.ghcup/*
key: ghcup-0-${{matrix.ghc}}
# The random number towards the beginning of the cache keys below are meant to be bumped as a crude means to clear
# a cache. GitHub will automatically delete caches that haven't been accessed in 7 days, but there is no way to
# purge one manually.
# Cache dependencies stored in ~/.cabal/store
- uses: actions/cache@v2
name: Cache dependencies
with:
path: |
~/.cabal/config
~/.cabal/packages/hackage.haskell.org/
~/.cabal/store
key: cabal-1-${{matrix.ghc}}-${{hashFiles('cabal.project')}}
restore-keys: cabal-1-${{matrix.ghc}}-
# Cache dist-newstyle/ for fast incremental builds in CI.
# The main cache key includes this commit hash, so we'll always fall back to the most recent build on this branch,
# or master.
- uses: actions/cache@v2
name: Cache build
with:
path: dist-newstyle
key: dist-0-${{matrix.ghc}}-${{github.sha}}
restore-keys: dist-0-${{matrix.ghc}}-
# Install ghc
- name: Install ghc
if: steps.cache-ghc.outputs.cache-hit != 'true'
run: |
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
ghcup install ghc ${{matrix.ghc}}
# Add ghc to path
- name: Add ~/.ghcup/bin to path
run: echo "$HOME/.ghcup/bin" >> $GITHUB_PATH
- name: Cabal update
run: cabal update
- name: Build dependencies
run: cabal build reactive-banana:lib:reactive-banana --disable-optimization --only-dependencies --with-compiler ghc-${{matrix.ghc}}
# We need to build the library and tests with the default optimization level
# in order to test garbage collection
- name: Build library
run: cabal build reactive-banana:lib:reactive-banana --with-compiler ghc-${{matrix.ghc}}
- name: Build tests
run: cabal build reactive-banana:test:unit --with-compiler ghc-${{matrix.ghc}}
- name: Run tests
run: cabal run reactive-banana:test:unit --with-compiler ghc-${{matrix.ghc}}
- name: Generate docs
run: cabal haddock reactive-banana --disable-optimization --with-compiler ghc-${{matrix.ghc}}
- name: Cabal check
run: |
cd reactive-banana
cabal check