Skip to content

Merge IOHK fork

Merge IOHK fork #198

Workflow file for this run

# modified from https://github.com/jgm/pandoc/blob/master/.github/workflows/ci.yml
name: Haskell library and example
on:
push:
branches:
- '**'
paths-ignore: []
pull_request:
paths-ignore: []
jobs:
linux:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
versions:
- ghc: '9.2.4'
cabal: '3.6'
- ghc: '9.4.6'
cabal: '3.6'
# - ghc: '9.6.3'
# cabal: '3.6'
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: Set up a PureScript toolchain
# uses: purescript-contrib/setup-purescript@main
# with: # https://github.com/purescript-contrib/setup-purescript#specify-versions
# spago: "latest"
# purescript: "0.15.13"
- name: Set up new Spago
run: npm install -g spago@next purescript
- name: Cache PureScript dependencies
uses: actions/cache@v2
with:
key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }}
path: |
.spago
output
test/RoundTripArgonautAesonGeneric/app/output
test/RoundTripJsonHelpers/app/output
- name: Install dependencies
run: |
cabal update
cabal build all --dependencies-only --enable-tests --disable-optimization
- name: Build Haskell
run: |
cabal build all --enable-tests --disable-optimization 2>&1 | tee build.log
- name: Build PureScript root project
run: spago build
- name: Build PureScript Argonaut test project
run: |
cd test/RoundTripArgonautAesonGeneric/app
spago build
- name: Build PureScript JsonHelpers test project
run: |
cd test/RoundTripJsonHelpers/app
spago build
- name: Test
run: |
# There are two PureScript projects which the Haskell tests build and run.
# The first build produces warnings which cause the Haskell tests to fail;
# pre-building these two projects clears these warnings.
spago build
cd test/RoundTripArgonautAesonGeneric/app
spago build
cd ../../../
cd test/RoundTripJsonHelpers/app
spago build
cd ../../../
cabal test all --disable-optimization