Skip to content

Commit ddf4a82

Browse files
committed
Try caching ghcup in CI
This might avoid having to really use ghcup to install ghc and cabal. Change-Id: Id000000006ec5f91636e503bb15f4ebeef74690d Merge commit
1 parent 464a9d7 commit ddf4a82

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

.github/workflows/applications.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
MATRIX="$(jq -c '.' <<EOF
136136
{
137137
# The first version in this list is the version to be used for release
138-
"ghc": ["9.8.2", "9.10.1", "9.6.6"],
138+
"ghc": ["9.10.1", "9.6.6"],
139139
"cabal": ["3.12"],
140140
"os": ["ubuntu-22.04"],
141141
"use-freeze-file": ["false"],
@@ -153,7 +153,7 @@ jobs:
153153
else
154154
MATRIX="$(jq -c '.' <<EOF
155155
{
156-
"ghc": ["9.8.2", "9.10.1", "9.6.6"],
156+
"ghc": ["9.10.1", "9.6.6"],
157157
"cabal": ["3.12"],
158158
"os": ["ubuntu-22.04"],
159159
"use-freeze-file": ["false"],
@@ -250,6 +250,18 @@ jobs:
250250
- name: Set permissions for .ghcup
251251
if: startsWith(matrix.os, 'ubuntu-')
252252
run: sudo chown -R $USER /usr/local/.ghcup
253+
- uses: actions/cache@v4
254+
name: cache
255+
with:
256+
path: |
257+
~/.ghcup
258+
~/.cabal/packages
259+
~/.cabal/store
260+
dist-newstyle
261+
key: ${{ env.key }}-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.*', '*.cabal', 'src/**', 'test/**') }}
262+
restore-keys: |
263+
${{ env.key }}-${{ matrix.os }}-${{ matrix.ghc }}-
264+
253265
- name: Install GHC and Cabal
254266
id: setup
255267
uses: haskell-actions/setup@v2
@@ -261,8 +273,11 @@ jobs:
261273
echo "setup ghc-version: ${{ steps.setup.outputs.ghc-version }}"
262274
echo "setup cabal-version: ${{ steps.setup.outputs.cabal-version }}"
263275
echo "setup cabal-store: ${{ steps.setup.outputs.cabal-store }}"
276+
which ghc
264277
ghc --version
278+
which cabal
265279
cabal --version
280+
266281
- name: Install non-Haskell dependencies (ubuntu)
267282
if: contains(matrix.os, 'ubuntu')
268283
run: sudo apt-get install -y libgflags-dev liblz4-dev libzstd-dev libsnappy-dev libbz2-dev libmpfr-dev
@@ -314,19 +329,6 @@ jobs:
314329
ghc-options: -debug
315330
EOF
316331
317-
# dist cache
318-
# the cache-key forces uploading of cache at least once a day, which ensures that
319-
# upstream dependency changes are captured regularly.
320-
- uses: actions/cache@v4
321-
name: Cache dist-newstyle
322-
with:
323-
path: |
324-
dist-newstyle
325-
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.use-freeze-file }}-2-${{ hashFiles('cabal.*', '*.cabal', 'src/**', 'test/**') }}
326-
restore-keys: |
327-
${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.use-freeze-file }}-2-
328-
${{ matrix.os }}-${{ matrix.ghc }}-
329-
330332
# Build
331333
- name: Delete Freeze file if it exists
332334
if: matrix.use-freeze-file != 'true'

.github/workflows/macos.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
key: ${{ runner.os }}-${{ runner.arch }}-ghc-cabal
3333
with:
3434
path: |
35-
/Users/runner/.ghcup
35+
/home/runner/.ghcup
3636
key: ${{ env.key }}-${{ hashFiles('bin/cabal', 'bin/ghc') }}
3737
restore-keys: ${{ env.key }}-
3838

@@ -71,7 +71,7 @@ jobs:
7171
if: steps.ghc-cabal-cache.outputs.cache-hit != 'true'
7272
with:
7373
path: |
74-
/Users/runner/.ghcup
74+
/home/runner/.ghcup
7575
key: ${{ steps.ghc-cabal-cache.outputs.cache-primary-key }}
7676

7777
- name: Install non-Haskell dependencies (macOS)
@@ -171,4 +171,3 @@ jobs:
171171
exit 1
172172
fi
173173
mv cabal.project.freeze.backup cabal.project.freeze
174-

0 commit comments

Comments
 (0)