Skip to content

Commit e95a1d6

Browse files
authored
Merge pull request #403 from BinderDavid/fix-402
Fix github action cache
2 parents 58e2263 + 69ac56a commit e95a1d6

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

.github/workflows/pullrequest-ci.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,44 @@ jobs:
99
build-and-test:
1010
name: Build site
1111
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
ghc: ["9.2.5"]
15+
cabal: ["3.10.1"]
16+
17+
defaults:
18+
run:
19+
working-directory: message-index
1220

1321
steps:
14-
- name: Install GHC 9.2.5
15-
run: ghcup install ghc 9.2.5
16-
17-
- name: Select GHC 9.2.5
18-
run: ghcup set ghc 9.2.5
19-
2022
- name: Check out repo
2123
uses: actions/checkout@v3
24+
25+
- name: Install Haskell Toolchain
26+
uses: haskell/actions/setup@v2
27+
with:
28+
ghc-version: ${{ matrix.ghc }}
29+
cabal-version: ${{ matrix.cabal }}
30+
31+
- name: Configure the build plan
32+
run: |
33+
cabal update
34+
cabal build --dry-run
35+
# cabal build --dry-run creates dist-newstyle/cache/plan.json
36+
# Keep a watch on this `cabal-3.9 build --dry-run` bug:
37+
# https://github.com/haskell/cabal/issues/8706
2238

2339
- name: Read the Cabal cache
2440
uses: actions/cache@v3
2541
with:
2642
path: |
2743
~/.cabal/store
2844
message-index/dist-newstyle
29-
key: cabal-cache-0-${{ hashFiles('message-index/message-index.cabal') }}
45+
key: |
46+
cabal-cache-ghc-${{ matrix.ghc }}-cabal-${{ matrix.cabal }}-${{ hashFiles('**/plan.json') }}
3047
restore-keys: |
31-
cabal-cache-0
48+
cabal-cache-ghc-${{ matrix.ghc }}-cabal-${{ matrix.cabal }}-
3249
33-
- name: Update the Cabal index
34-
run: cabal update
3550
3651
- name: Build with Hakyll
3752
working-directory: message-index

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ If you're a Haskell tool developer who would like to integrate your project with
1010
## Running Locally
1111

1212
The site is built with the [Hakyll](https://jaspervdj.be/hakyll/) static site generator. To view the site locally, enter the `message-index` directory and run:
13-
```
13+
```console
1414
$ cabal run -- site watch
1515
```
1616
or
17-
```
17+
```console
1818
$ stack run -- site watch
1919
```
2020
which fires up an HTTP server on `localhost:8000`.

0 commit comments

Comments
 (0)