Skip to content

Commit

Permalink
Github Actions in CI to check both ghc-8.6.5 and ghc-8.10.2 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Oct 19, 2020
1 parent 5868c6b commit 305baec
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/haskell.yml
@@ -0,0 +1,60 @@
name: Haskell CI

on: [push]

jobs:
build:
runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash

strategy:
fail-fast: false
matrix:
ghc: ["8.6.5", "8.10.2"]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
- os: macos-latest
ghc: 8.6.5

steps:
- uses: actions/checkout@v1

- name: Select build directory
run: echo "CABAL_BUILDDIR=dist" >> $GITHUB_ENV

- uses: actions/setup-haskell@v1
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.2.0.0'

- name: Cabal update
run: cabal update

- name: Cabal Configure
run: cabal configure --builddir="$CABAL_BUILDDIR" --enable-tests --enable-benchmarks --write-ghc-environment-files=always

- uses: actions/cache@v2
if: matrix.os != 'macos-latest'
name: Cache cabal store
with:
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist
key: cache-${{ runner.os }}-${{ matrix.ghc }}-v1-${{ hashFiles('cabal-cache.cabal') }}-${{ github.sha }}
restore-keys: cache-${{ runner.os }}-${{ matrix.ghc }}-v1-${{ hashFiles('cabal-cache.cabal') }}-

- name: Install dependencies
run: cabal build all --builddir="$CABAL_BUILDDIR" --only-dependencies

- name: Build
run: cabal build all --builddir="$CABAL_BUILDDIR"

- name: Git clone
run: git clone https://github.com/input-output-hk/cardano-mainnet-mirror

- name: Run tests
run: cabal test all --builddir="$CABAL_BUILDDIR"

0 comments on commit 305baec

Please sign in to comment.