Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Stack: add ubuntu-24.04; Cabal: tweak cache logic #104

Merged
merged 2 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions .github/workflows/cabal-mac-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,30 @@ 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: |
cabal configure --enable-tests
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: |
Expand All @@ -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 }}
6 changes: 5 additions & 1 deletion .github/workflows/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Loading