Skip to content

replace nix-shell with Nix Flake #56

replace nix-shell with Nix Flake

replace nix-shell with Nix Flake #56

Workflow file for this run

name: Build
on:
push:
paths-ignore:
- 'docs/*/**'
pull_request:
jobs:
continuous-integration:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- ghc-version: "8.10.7"
cabal-flags: ""
- ghc-version: "9.0.2"
cabal-flags: ""
- ghc-version: "9.2.8"
cabal-flags: ""
- ghc-version: "9.4.5"
cabal-flags: ""
- ghc-version: "9.6.4"
cabal-flags: ""
- ghc-version: "9.8.2"
cabal-flags: ""
- ghc-version: "9.10.1"
cabal-flags: ""
# Temporary cabal flags until all dependencies are updated
- ghc-version: "9.12.1"
cabal-flags: "--allow-newer=base --allow-newer=template-haskell --allow-newer=ghc-prim"
steps:
- uses: actions/checkout@v4
- name: Install cabal/ghc
uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc-version }}
cabal-version: '3.12.1.0'
- name: Generate freeze file
run: |
cabal update
cabal configure --disable-optimization --enable-tests
cabal freeze ${{matrix.cabal-flags}}
# Exclude the timestamp of Hackage index update from our cache key, to
# avoid invalidating cache too often.
# This idea comes from github.com/jaspervdj/hakyll
sed '/^index-state: /d' cabal.project.freeze > dependencies-versions
- name: Cache cabal work
uses: actions/cache@v4
with:
path: |
dist-newstyle
${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-${{ hashFiles('dependencies-versions', 'cabal.project.local') }}-cabal-install
- name: Build dependencies
run: |
cabal build all --only-dependencies ${{matrix.cabal-flags}}
- name: Build beam packages
run: |
cabal build all ${{matrix.cabal-flags}}
- name: Run tests
run: |
cabal test all ${{matrix.cabal-flags}}