Skip to content

Commit

Permalink
CI bump to GHC 9.8 and latest majors; use build plan as cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasabel committed Nov 3, 2023
1 parent 47a4746 commit bdc4673
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 101 deletions.
56 changes: 33 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,59 @@
name: CI
on:
- push
- pull_request
jobs:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
cabal:
name: ${{ matrix.os }} - GHC ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
ghc:
- 9.2.7
- 9.4.4
- 9.6.1
- 9.8
- 9.6
- 9.4
- 9.2
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: haskell/actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
- name: Setup Haskell
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}

- name: Configure
run: |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
cabal build all --dry-run
- name: Restore cache
uses: actions/cache/restore@v3
id: cache
with:
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-plan-${{ hashfiles('dist-newstyle/cache/plan.json') }}
restore-keys: |
${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-
- name: Build
run: |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
cabal build all
- name: Build dependencies
run: cabal build all --dependencies-only

- name: Test
run: |
cabal test all
- run: cabal build all
- run: cabal test all
- run: cabal haddock
- run: cabal check
- run: cabal sdist

- name: Save cache
uses: actions/cache/save@v3
if: always()
if: always()
with:
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
path: ${{ steps.setup.outputs.cabal-store }}
66 changes: 0 additions & 66 deletions stack.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions stack.yaml.lock

This file was deleted.

0 comments on commit bdc4673

Please sign in to comment.