Skip to content

Commit 6caa871

Browse files
committed
CI: cabal-3.10 compat: actions/cache has to go before cabal update
1 parent 330b08f commit 6caa871

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

.github/workflows/validate.yml

+39-39
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ jobs:
5757

5858
- uses: actions/checkout@v3
5959

60+
# See the following link for a breakdown of the following step
61+
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
62+
#
63+
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
64+
- if: ${{ runner.os != 'Windows' }}
65+
uses: actions/cache@v3
66+
with:
67+
# validate.sh uses a special build dir
68+
path: |
69+
${{ steps.setup-haskell.outputs.cabal-store }}
70+
dist-*
71+
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
72+
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-
73+
6074
# See https://github.com/haskell/cabal/pull/8739
6175
- name: Sudo chmod to permit ghcup to update its cache
6276
run: |
@@ -73,20 +87,6 @@ jobs:
7387
ghc-version: ${{ matrix.ghc }}
7488
cabal-version: '3.8.1.0'
7589

76-
# See the following link for a breakdown of the following step
77-
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
78-
#
79-
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
80-
- if: ${{ runner.os != 'Windows' }}
81-
uses: actions/cache@v3
82-
with:
83-
# validate.sh uses a special build dir
84-
path: |
85-
${{ steps.setup-haskell.outputs.cabal-store }}
86-
dist-*
87-
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
88-
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-
89-
9090
- name: Work around git problem https://bugs.launchpad.net/ubuntu/+source/git/+bug/1993586 (cabal PR #8546)
9191
run: |
9292
git config --global protocol.file.allow always
@@ -206,6 +206,20 @@ jobs:
206206

207207
- uses: actions/checkout@v3
208208

209+
# See the following link for a breakdown of the following step
210+
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
211+
#
212+
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
213+
- if: ${{ runner.os != 'Windows' }}
214+
uses: actions/cache@v3
215+
with:
216+
# validate.sh uses a special build dir
217+
path: |
218+
${{ steps.setup-haskell.outputs.cabal-store }}
219+
dist-*
220+
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
221+
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-
222+
209223
# See https://github.com/haskell/cabal/pull/8739
210224
- name: Sudo chmod to permit ghcup to update its cache
211225
run: |
@@ -227,20 +241,6 @@ jobs:
227241
ghc --version
228242
cabal update
229243
230-
# See the following link for a breakdown of the following step
231-
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
232-
#
233-
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
234-
- if: ${{ runner.os != 'Windows' }}
235-
uses: actions/cache@v3
236-
with:
237-
# validate.sh uses a special build dir
238-
path: |
239-
${{ steps.setup-haskell.outputs.cabal-store }}
240-
dist-*
241-
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
242-
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-
243-
244244
- name: Work around git problem https://bugs.launchpad.net/ubuntu/+source/git/+bug/1993586 (cabal PR #8546)
245245
run: |
246246
git config --global protocol.file.allow always
@@ -348,17 +348,6 @@ jobs:
348348
git fetch origin $GITHUB_SHA:temporary-ci-branch
349349
git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA)
350350
351-
- name: Install extra compiler
352-
run: |
353-
apt-get update
354-
apt-get install -y ghc-${{ matrix.extra-ghc }}-dyn
355-
356-
- uses: haskell/actions/setup@v2
357-
id: setup-haskell
358-
with:
359-
ghc-version: ${{ matrix.ghc }}
360-
cabal-version: '3.8.1.0'
361-
362351
# As we are reusing the cached build dir from the previous step
363352
# the generated artifacts are available here,
364353
# including the cabal executable and the test suite
@@ -370,6 +359,17 @@ jobs:
370359
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
371360
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-
372361

362+
- name: Install extra compiler
363+
run: |
364+
apt-get update
365+
apt-get install -y ghc-${{ matrix.extra-ghc }}-dyn
366+
367+
- uses: haskell/actions/setup@v2
368+
id: setup-haskell
369+
with:
370+
ghc-version: ${{ matrix.ghc }}
371+
cabal-version: '3.8.1.0'
372+
373373
- name: Install cabal-plan
374374
run: |
375375
cd $(mktemp -d)

0 commit comments

Comments
 (0)