@@ -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"],
@@ -247,9 +247,29 @@ jobs:
247247 # done
248248
249249 # work around for https://github.com/haskell/actions/issues/187
250- - name : Set permissions for .ghcup
251- if : startsWith(matrix.os, 'ubuntu-')
252- run : sudo chown -R $USER /usr/local/.ghcup
250+ - uses : actions/cache/restore@v4
251+ name : Restore ghc & cabal binaries cache
252+ id : ghc-cabal-cache
253+ env :
254+ key : ${{ runner.os }}-ghc-cabal
255+ with :
256+ path : |
257+ ~/.ghcup
258+ key : ghcup-${{ env.key }}-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('bin/cabal', 'bin/ghc') }}
259+ restore-keys : ghcup-${{ env.key }}-${{ matrix.os }}-${{ matrix.ghc }}-
260+
261+ - uses : actions/cache/restore@v4
262+ name : Restore dist-newstyle cache
263+ id : cabal-dist-cache
264+ with :
265+ path : |
266+ ~/.cabal/packages
267+ ~/.cabal/store
268+ dist-newstyle
269+ key : cabal-${{ env.key }}-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.*', '*.cabal', 'src/**', 'test/**') }}
270+ restore-keys : |
271+ cabal-${{ env.key }}-${{ matrix.os }}-${{ matrix.ghc }}-
272+
253273 - name : Install GHC and Cabal
254274 id : setup
255275 uses : haskell-actions/setup@v2
@@ -261,8 +281,19 @@ jobs:
261281 echo "setup ghc-version: ${{ steps.setup.outputs.ghc-version }}"
262282 echo "setup cabal-version: ${{ steps.setup.outputs.cabal-version }}"
263283 echo "setup cabal-store: ${{ steps.setup.outputs.cabal-store }}"
284+ which ghc
264285 ghc --version
286+ which cabal
265287 cabal --version
288+
289+ - uses : actions/cache/save@v4
290+ name : Cache ghc & cabal binaries
291+ if : steps.ghc-cabal-cache.outputs.cache-hit != 'true'
292+ with :
293+ path : |
294+ ~/.ghcup
295+ key : ghcup-${{ env.key }}-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('bin/cabal', 'bin/ghc') }}
296+
266297 - name : Install non-Haskell dependencies (ubuntu)
267298 if : contains(matrix.os, 'ubuntu')
268299 run : sudo apt-get install -y libgflags-dev liblz4-dev libzstd-dev libsnappy-dev libbz2-dev libmpfr-dev
@@ -314,19 +345,6 @@ jobs:
314345 ghc-options: -debug
315346 EOF
316347
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-
330348 # Build
331349 - name : Delete Freeze file if it exists
332350 if : matrix.use-freeze-file != 'true'
@@ -381,6 +399,16 @@ jobs:
381399 - name : Build chainweb-node application
382400 run : cabal build -j2 --ghc-options=-j2 chainweb-node:exe:chainweb-node
383401
402+ # dist cache
403+ # the cache-key forces uploading of cache at least once a day, which ensures that
404+ # upstream dependency changes are captured regularly.
405+ - uses : actions/cache/save@v4
406+ name : Save dist-newstyle cache
407+ with :
408+ path : |
409+ dist-newstyle
410+ key : cabal-${{ steps.cabal-dist-cache.outputs.cache-primary-key }}
411+
384412 # Checks
385413 - name : Check that working directory tree is clean
386414 run : |
0 commit comments