Skip to content

Commit

Permalink
Cache .hie directory in CI (#2490)
Browse files Browse the repository at this point in the history
We use the options in `package.yaml`.

```
         - -fhide-source-paths
         - -fwrite-ide-info -hiedir=.hie
```
If a previously available .hie directory is missing then GHC will
rebuild the whole project with reason: `[HIE file is missing]`. So we
need to cache it to take advantage of incremental builds.
  • Loading branch information
paulcadman authored Nov 1, 2023
1 parent 21d5034 commit 7f009ce
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ jobs:
cd main
make runtime
# We use the options:
# - -fhide-source-paths
# - -fwrite-ide-info -hiedir=.hie
# in package.yaml.
#
# If a previously available .hie directory is missing then GHC will rebuild the whole project.
# with reason: HIE file is missing. So we need to cache it.
- name: Cache .hie
id: cache-hie
uses: actions/cache@v3
with:
path: main/.hie
key: ${{ runner.os }}-stack-hie

- name: Stack setup
id: stack
uses: freckle/stack-action@v4
Expand Down Expand Up @@ -252,6 +266,20 @@ jobs:
cd main
make CC=$CC LIBTOOL=$LIBTOOL runtime
# We use the options:
# - -fhide-source-paths
# - -fwrite-ide-info -hiedir=.hie
# in package.yaml.
#
# If a previously available .hie directory is missing then GHC will rebuild the whole project.
# with reason: HIE file is missing. So we need to cache it.
- name: Cache .hie
id: cache-hie
uses: actions/cache@v3
with:
path: main/.hie
key: ${{ runner.os }}-stack-hie

- name: Stack setup
id: stack
uses: freckle/stack-action@v4
Expand Down

0 comments on commit 7f009ce

Please sign in to comment.