Skip to content

Commit

Permalink
Updating GitHub actions [1]
Browse files Browse the repository at this point in the history
  • Loading branch information
recursion-ninja committed Aug 28, 2024
1 parent 166810e commit e7f4add
Showing 1 changed file with 34 additions and 17 deletions.
51 changes: 34 additions & 17 deletions .github/workflows/integration-test-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ on:

# Build every pull request, to check for regressions.
pull_request:
branches: [ main ]

# Build on branch updates
push:
branches: [ github-ci ]
branches: [ main, github-ci ]


################################################################################
Expand All @@ -49,30 +50,46 @@ jobs:

steps:
- name: 'Clone Project'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Setup Haskell'
uses: haskell/actions/setup@v2
uses: haskell-actions/setup@v2
with:
ghc-version: 9.2
cabal-version: 3.6
ghc-version: 9.10
cabal-version: 3.12

- name: 'Cabal - Configure'
run: |
cabal update ${PROJECTFILE}
cabal clean ${PROJECTFILE}
cabal freeze ${PROJECTFILE}
cabal update ${PROJECTFILE}
cabal clean ${PROJECTFILE}
cabal freeze ${PROJECTFILE}
cabal configure ${PROJECTFILE} --enable-tests --enable-benchmarks --disable-documentation
cabal build all ${PROJECTFILE} --dry-run
# The last step generates dist-newstyle/cache/plan.json for the cache key.
- name: 'Cabal - Cache'
uses: actions/cache@v3
- name: 'Cabal - Cache [1]'
uses: actions/cache/restore@v4
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: |
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
# restore keys is a fall back when the freeze plan is different
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-

- name: 'Cabal - Install dependencies'
# If we had an exact cache hit, the dependencies will be up to date.
if: steps.cache.outputs.cache-hit != 'true'
run: cabal build all --only-dependencies

# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
- name: 'Cabal - Cache [2]'
uses: actions/cache/save@v4
# If we had an exact cache hit, trying to save the cache would error because of key clash.
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: 'Cabal - Build'
run: |
Expand Down

0 comments on commit e7f4add

Please sign in to comment.