@@ -311,7 +311,11 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do
311
311
Binary. put cfgGhcupJobs -- GHC location affects doctest, e.g
312
312
313
313
when (doctestEnabled) $ githubUses " cache (tools)" " actions/cache/restore@v4"
314
- [ (" key" , " ${{ runner.os }}-${{ matrix.compiler }}-tools-" ++ toolsConfigHash)
314
+ [ (" key" , intercalate " -" [
315
+ ghWrapExpr " runner.os"
316
+ , ghWrapExpr " matrix.compiler"
317
+ , " tools" , toolsConfigHash
318
+ ])
315
319
, (" path" , " ~/.haskell-ci-tools" )
316
320
]
317
321
@@ -348,7 +352,12 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do
348
352
sh_if range " doctest --version"
349
353
350
354
when (doctestEnabled) $ githubUsesIf " save cache (tools)" " actions/cache/save@v4" " always()"
351
- [ (" key" , " ${{ runner.os }}-${{ matrix.compiler }}-tools-" ++ toolsConfigHash)
355
+ [ (" key" , intercalate " -" [
356
+ ghWrapExpr " runner.os"
357
+ , ghWrapExpr " matrix.compiler"
358
+ , " tools"
359
+ , toolsConfigHash
360
+ ])
352
361
, (" path" , " ~/.haskell-ci-tools" )
353
362
]
354
363
@@ -444,8 +453,16 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do
444
453
-- This a hack. https://github.com/actions/cache/issues/109
445
454
-- Hashing Java - Maven style.
446
455
githubUses " restore cache" " actions/cache/restore@v4"
447
- [ (" key" , " ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}" )
448
- , (" restore-keys" , " ${{ runner.os }}-${{ matrix.compiler }}-" )
456
+ [ (" key" , intercalate " -" [
457
+ ghWrapExpr " runner.os"
458
+ , ghWrapExpr " matrix.compiler"
459
+ , ghWrapExpr " github.sha"
460
+ ])
461
+ , (" restore-keys" , intercalate " -" [
462
+ ghWrapExpr " runner.os"
463
+ , ghWrapExpr " matrix.compiler"
464
+ , " "
465
+ ]) -- Includes a trailing dash
449
466
, (" path" , " ~/.cabal/store" )
450
467
]
451
468
@@ -579,7 +596,11 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do
579
596
sh_cs $ " $CABAL v2-haddock --disable-documentation" ++ haddockFlags ++ " $ARG_COMPILER " ++ withHaddock ++ " " ++ allFlags ++ " all"
580
597
581
598
githubUsesIf " save cache" " actions/cache/save@v4" " always()"
582
- [ (" key" , " ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}" )
599
+ [ (" key" , intercalate " -" [
600
+ ghWrapExpr " runner.os"
601
+ , ghWrapExpr " matrix.compiler"
602
+ , ghWrapExpr " github.sha"
603
+ ])
583
604
, (" path" , " ~/.cabal/store" )
584
605
]
585
606
@@ -591,7 +612,7 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do
591
612
}
592
613
, ghJobs = Map. fromList $ buildList $ do
593
614
item (mainJobName, GitHubJob
594
- { ghjName = actionName ++ " - Linux - ${{ matrix.compiler }} "
615
+ { ghjName = intercalate " - " [actionName, " Linux " , ghWrapExpr " matrix.compiler" ]
595
616
-- NB: The Ubuntu version used in `runs-on` isn't
596
617
-- particularly important since we use a Docker container.
597
618
, ghjRunsOn = ghcRunsOnVer
0 commit comments