Skip to content

Commit aa6f071

Browse files
committed
CI: no need to restore cache before setup-haskell
undo 6bd17fc from #8844; the change was made in response to an issue that was later fixed on the haskell/action side
1 parent 3ffdf39 commit aa6f071

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

.github/workflows/validate.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ jobs:
5757

5858
- uses: actions/checkout@v3
5959

60+
- uses: haskell/actions/setup@v2
61+
id: setup-haskell
62+
with:
63+
ghc-version: ${{ matrix.ghc }}
64+
cabal-version: '3.10.1.0'
65+
6066
# See the following link for a breakdown of the following step
6167
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
6268
- uses: actions/cache@v3
@@ -68,12 +74,6 @@ jobs:
6874
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
6975
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-
7076

71-
- uses: haskell/actions/setup@v2
72-
id: setup-haskell
73-
with:
74-
ghc-version: ${{ matrix.ghc }}
75-
cabal-version: '3.10.1.0'
76-
7777
# The '+exe' constraint below is important, otherwise cabal-install
7878
# might decide to build the library but not the executable which is
7979
# what we need.
@@ -202,19 +202,6 @@ jobs:
202202

203203
- uses: actions/checkout@v3
204204

205-
# See the following link for a breakdown of the following step
206-
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
207-
#
208-
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
209-
- uses: actions/cache@v3
210-
with:
211-
# validate.sh uses a special build dir
212-
path: |
213-
${{ steps.setup-haskell.outputs.cabal-store }}
214-
dist-*
215-
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
216-
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-
217-
218205
# See https://github.com/haskell/cabal/pull/8739
219206
- name: Sudo chmod to permit ghcup to update its cache
220207
run: |
@@ -236,6 +223,19 @@ jobs:
236223
ghc --version
237224
cabal update
238225
226+
# See the following link for a breakdown of the following step
227+
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
228+
#
229+
# See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded
230+
- uses: actions/cache@v3
231+
with:
232+
# validate.sh uses a special build dir
233+
path: |
234+
${{ steps.setup-haskell.outputs.cabal-store }}
235+
dist-*
236+
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
237+
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-
238+
239239
# The '+exe' constraint below is important, otherwise cabal-install
240240
# might decide to build the library but not the executable which is
241241
# what we need.
@@ -339,17 +339,6 @@ jobs:
339339
git fetch origin $GITHUB_SHA:temporary-ci-branch
340340
git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA)
341341
342-
# As we are reusing the cached build dir from the previous step
343-
# the generated artifacts are available here,
344-
# including the cabal executable and the test suite
345-
- uses: actions/cache@v3
346-
with:
347-
path: |
348-
${{ steps.setup-haskell.outputs.cabal-store }}
349-
dist-*
350-
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
351-
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-
352-
353342
- name: Install extra compiler
354343
run: |
355344
apt-get update
@@ -361,6 +350,17 @@ jobs:
361350
ghc-version: ${{ matrix.ghc }}
362351
cabal-version: latest # latest is mandatory for cabal-testsuite, see https://github.com/haskell/cabal/issues/8133
363352

353+
# As we are reusing the cached build dir from the previous step
354+
# the generated artifacts are available here,
355+
# including the cabal executable and the test suite
356+
- uses: actions/cache@v3
357+
with:
358+
path: |
359+
${{ steps.setup-haskell.outputs.cabal-store }}
360+
dist-*
361+
key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }}
362+
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419-
363+
364364
- name: Install cabal-plan
365365
run: |
366366
cd $(mktemp -d)

0 commit comments

Comments
 (0)