Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
berberman committed Sep 19, 2023
1 parent c05e255 commit 1aec5c6
Showing 1 changed file with 36 additions and 33 deletions.
69 changes: 36 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,48 @@ on:
push:
branches: [master]

permissions:
contents: read

jobs:
build:
name: GHC ${{ matrix.ghc-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
cabal: ["3.2.0.0", "3.4.0.0", "3.6.0.0", "3.8.0.0"]
ghc: ["8.10.7", "9.0.2", "9.2.2", "9.4.6"]
os: [ubuntu-latest]
exclude:
- cabal: "3.2.0.0"
ghc: "9.0.2"
- cabal: "3.2.0.0"
ghc: "9.2.2"
- cabal: "3.4.0.0"
ghc: "9.2.2"
- cabal: "3.6.0.0"
ghc: "8.10.7"
- cabal: "3.6.0.0"
ghc: "9.0.2"
ghc-version: ['9.4', '9.2', '9.0', '8.10']
steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'

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

- uses: actions/cache@v1
name: Cache ~/.cabal/store
with:
path: ~/.cabal/store
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal
- name: Set up GHC ${{ matrix.ghc-version }}
uses: haskell/actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc-version }}
cabal-version: 'latest'

- name: Build
run: |
cabal v2-update
cabal v2-build --enable-tests --enable-benchmarks
- name: Test
run: |
cabal v2-test
- name: Configure the build
run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build --dry-run
- name: Restore cached dependencies
uses: actions/cache/restore@v3
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-
- name: Install dependencies
run: cabal build all --only-dependencies
- name: Save cached dependencies
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: Build
run: cabal build all

0 comments on commit 1aec5c6

Please sign in to comment.