From 8039bdff11c9ba4654a9f35caecbc34faf228a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Mon, 9 Oct 2023 15:24:15 +0200 Subject: [PATCH] Update CI & fix cabal caching --- .github/workflows/ci.yml | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba6e134f3..92dc4dbb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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' }} @@ -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: | @@ -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