Cache hoogle db
authorLuke Lau <luke_lau@icloud.com>
Tue, 21 Jan 2020 10:16:48 +0000 (10:16 +0000)
committerLuke Lau <luke_lau@icloud.com>
Tue, 21 Jan 2020 10:16:48 +0000 (10:16 +0000)
.github/workflows/haskell.yml

index f7e11706f6197c33cdab48287a7cb7d2ce51c403..4f5dda47c2136109c42d284c203216d82e34c30e 100644 (file)
@@ -41,6 +41,12 @@ jobs:
         restore-keys: |
           ${{ runner.OS }}-${{ matrix.ghc }}-cabal
 
+    - name: Cache Hoogle
+      uses: actions/cache@v1.1.0
+      with:
+        path: ~/.hoogle
+        key: ${{ runner.OS }}-${{ matrix.ghc }}-hoogle-${{ env.hieref }}
+
     - name: Build HIE
       run: |
         if [ -e $HOME/.cabal/bin/hie ]; then
@@ -52,7 +58,12 @@ jobs:
         cabal install hoogle
         popd
     - name: Generate hoogle database
-      run: hoogle generate
+      run: |
+        if [ -d $HOME/.hoogle ]; then
+           echo "hoogle database already built"
+           exit 0
+        fi
+        hoogle generate
     - name: Install JS Language Server
       run: npm install javascript-typescript-langserver
     - name: Build