Skip to content

Merge pull request #276 from HeinrichApfelmus/delete-action-type #237

Merge pull request #276 from HeinrichApfelmus/delete-action-type

Merge pull request #276 from HeinrichApfelmus/delete-action-type #237

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.4.1'
allow-failure: true
- ghc: '9.2.4'
allow-failure: true
# As of 2021-02-20, 9.0.1 build fails due to pqueue's upper bound on base
# - '9.0.1'
- 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
# We get linker errors when building the test suite. They look like this:
# relocation R_X86_64_32S against symbol `stg_upd_frame_info' can not be used when making a PIE object; recompile with -fPIC
# - '7.10.3'
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