Skip to content

Commit

Permalink
Update CI & fix cabal caching
Browse files Browse the repository at this point in the history
  • Loading branch information
turion committed Oct 9, 2023
1 parent 6ec0c93 commit 056c964
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,26 @@ jobs:
name: Haskell GHC ${{ matrix.ghc }} cabal
steps:
- uses: actions/checkout@v4
- uses: haskell/actions/setup@v2
id: setup-haskell-build
- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
- name: Install dependencies
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev
- name: Cache Cabal build artifacts
uses: actions/cache@v3
- name: Restore Cabal cache
uses: actions/cache/restore@v3
id: cache
env:
key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: |
${{ steps.setup-haskell-build.outputs.cabal-store }}
${{ steps.setup.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-cabal-${{ matrix.ghc }}
restore-keys: |
${{ runner.os }}-cabal-${{ matrix.ghc }}
- name: Cabal update
run: cabal update
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}

- name: Cabal build dependencies except rhine-bayes
# Temporarily disable building rhine-bayes on GHC 9.4.4
if: ${{ matrix.ghc == '9.4.4' }}
Expand All @@ -87,6 +88,14 @@ jobs:
if: ${{ matrix.ghc != '9.4.4' }} # Because dependency monad-bayes doesn't support it yet, see https://github.com/tweag/monad-bayes/issues/259
run: |
cabal build all --enable-tests --only-dependencies
- name: Save Cabal dependency cache
uses: actions/cache/save@v3
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Cabal build packages except rhine-bayes
if: ${{ matrix.ghc == '9.4.4' }}
run: |
Expand All @@ -103,6 +112,7 @@ jobs:
if: ${{ matrix.ghc != '9.4.4' }} # Because dependency monad-bayes doesn't support it yet, see https://github.com/tweag/monad-bayes/issues/259
run: |
cabal test all --enable-tests --test-show-details=Always
build-stack:
runs-on: ubuntu-latest
needs: generateMatrix
Expand Down

0 comments on commit 056c964

Please sign in to comment.