Skip to content

Commit

Permalink
CI: cabal-3.10 compat: actions/cache has to go before cabal update
Browse files Browse the repository at this point in the history
  • Loading branch information
ulysses4ever committed Mar 13, 2023
1 parent d9ff7b7 commit e6e07e8
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ jobs:

- uses: actions/checkout@v3

# See the following link for a breakdown of the following step
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
#
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
- if: ${{ runner.os != 'Windows' }}
uses: actions/cache@v3
with:
# validate.sh uses a special build dir
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-*
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-

# See https://github.com/haskell/cabal/pull/8739
- name: Sudo chmod to permit ghcup to update its cache
run: |
Expand All @@ -73,20 +87,6 @@ jobs:
ghc-version: ${{ matrix.ghc }}
cabal-version: latest # latest is mandatory for cabal-testsuite, see https://github.com/haskell/cabal/issues/8133

# See the following link for a breakdown of the following step
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
#
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
- if: ${{ runner.os != 'Windows' }}
uses: actions/cache@v3
with:
# validate.sh uses a special build dir
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-*
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-

- name: Work around git problem https://bugs.launchpad.net/ubuntu/+source/git/+bug/1993586 (cabal PR #8546)
run: |
git config --global protocol.file.allow always
Expand Down Expand Up @@ -206,6 +206,20 @@ jobs:

- uses: actions/checkout@v3

# See the following link for a breakdown of the following step
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
#
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
- if: ${{ runner.os != 'Windows' }}
uses: actions/cache@v3
with:
# validate.sh uses a special build dir
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-*
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-

# See https://github.com/haskell/cabal/pull/8739
- name: Sudo chmod to permit ghcup to update its cache
run: |
Expand All @@ -227,20 +241,6 @@ jobs:
ghc --version
cabal update
# See the following link for a breakdown of the following step
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
#
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
- if: ${{ runner.os != 'Windows' }}
uses: actions/cache@v3
with:
# validate.sh uses a special build dir
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-*
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-

- name: Work around git problem https://bugs.launchpad.net/ubuntu/+source/git/+bug/1993586 (cabal PR #8546)
run: |
git config --global protocol.file.allow always
Expand Down Expand Up @@ -348,17 +348,6 @@ jobs:
git fetch origin $GITHUB_SHA:temporary-ci-branch
git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA)
- name: Install extra compiler
run: |
apt-get update
apt-get install -y ghc-${{ matrix.extra-ghc }}-dyn
- uses: haskell/actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: latest # latest is mandatory for cabal-testsuite, see https://github.com/haskell/cabal/issues/8133

# As we are reusing the cached build dir from the previous step
# the generated artifacts are available here,
# including the cabal executable and the test suite
Expand All @@ -370,6 +359,17 @@ jobs:
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-

- name: Install extra compiler
run: |
apt-get update
apt-get install -y ghc-${{ matrix.extra-ghc }}-dyn
- uses: haskell/actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: latest # latest is mandatory for cabal-testsuite, see https://github.com/haskell/cabal/issues/8133

- name: Install cabal-plan
run: |
cd $(mktemp -d)
Expand Down

0 comments on commit e6e07e8

Please sign in to comment.