From 7f009ce14c8f7ad677d8598887bd43c81a06244e Mon Sep 17 00:00:00 2001 From: Paul Cadman Date: Wed, 1 Nov 2023 13:15:53 +0000 Subject: [PATCH] Cache .hie directory in CI (#2490) 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. --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b48bc159b8..dd0ae4c316 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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