From 91f544ee6e95a1e075cb5c61e94a87997a1028e9 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Tue, 14 May 2024 22:29:34 +0100 Subject: [PATCH 1/2] CI Cabal mac/win: cache even when build failed --- .github/workflows/cabal-mac-win.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cabal-mac-win.yml b/.github/workflows/cabal-mac-win.yml index 9f66b94..3227b66 100644 --- a/.github/workflows/cabal-mac-win.yml +++ b/.github/workflows/cabal-mac-win.yml @@ -91,9 +91,10 @@ jobs: - name: Setup Haskell uses: haskell-actions/setup@v2 - id: setup-haskell-cabal + id: setup with: ghc-version: ${{ matrix.ghc }} + cabal-update: true - name: Configure run: | @@ -101,14 +102,19 @@ jobs: cabal build --dry-run # cabal build --dry-run creates dist-newstyle/cache/plan.json - - name: Cache ~/.cabal/store - uses: actions/cache@v4 + - name: Restore cached build products + uses: actions/cache/restore@v4 + id: cache with: path: | - ${{ steps.setup-haskell-cabal.outputs.cabal-store }} + ${{ steps.setup.outputs.cabal-store }} dist-newstyle - key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-icu-${{ env.ICU_VER }}-plan-${{ hashFiles('dist-newstyle/cache/plan.json') }} - restore-keys: ${{ runner.os }}-ghc-${{ matrix.ghc }}-icu-${{ env.ICU_VER }}- + key: ${{ env.key }}-cabal-${{ steps.setup.outputs.cabal-version }}-plan-${{ hashFiles('dist-newstyle/cache/plan.json') }} + restore-keys: | + ${{ env.key }}-cabal-${{ steps.setup.outputs.cabal-version }}- + ${{ env.key }}- + env: + key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-icu-${{ env.ICU_VER }}- - name: Build run: | @@ -117,3 +123,12 @@ jobs: - name: Test run: | cabal test all --test-show-details=direct + + - name: Cache build products + uses: actions/cache/save@v4 + if: always() && steps.cache.outputs.cache-hit != 'true' + with: + path: | + ${{ steps.setup.outputs.cabal-store }} + dist-newstyle + key: ${{ steps.cache.outputs.cache-primary-key }} From fd16898cbfd3ade85da934925700bb43093b3b01 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Tue, 14 May 2024 22:30:06 +0100 Subject: [PATCH 2/2] CI stack: add ubuntu-24.04 runner --- .github/workflows/stack.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stack.yml b/.github/workflows/stack.yml index b6df1ad..caecfa3 100644 --- a/.github/workflows/stack.yml +++ b/.github/workflows/stack.yml @@ -21,7 +21,11 @@ jobs: strategy: fail-fast: false matrix: - os: [macOS-latest,ubuntu-latest,windows-latest] + os: + - macOS-latest + - ubuntu-22.04 + - ubuntu-24.04 + - windows-latest plan: - resolver: 'nightly' - resolver: 'lts'