Try caching hie
[lsp-test.git] / .github / workflows / haskell.yml
1 name: Haskell CI
2
3 on: [push]
4 jobs:
5   build:
6    
7     runs-on: ${{ matrix.os }}
8
9     env:
10       hieref: 7cf1295a2804a527381331bb7b73d58255721edc
11
12     strategy:
13       matrix:
14         ghc: ['8.6.5']
15         os: [ubuntu-latest, macOS-latest]
16
17     steps:
18     - uses: actions/checkout@v1
19     - uses: bubba/setup-haskell@macos-ghcup
20       with:
21         ghc-version: ${{ matrix.ghc }}
22         cabal-version: '3.0'
23     - run: cabal update
24
25     - name: Clone HIE
26       uses: actions/checkout@v1
27       with:
28         repository: haskell/haskell-ide-engine
29         submodules: recurse
30         ref: ${{ env.hieref }}
31         path: haskell-ide-engine
32
33     - name: Cache cabal
34       uses: actions/cache@v1
35       with:
36         path: $HOME/.cabal
37         key: ${{ runner.OS }}-${{ matrix.ghc }}-${{ env.hieref }}
38
39     - name: Build HIE
40       run: |
41         if [ ! -f $HOME/.cabal/bin/hie ]; then
42             echo "hie is already built"
43             exit 0
44         fi
45         pushd haskell-ide-engine
46         cabal install hie
47         cabal install hoogle
48         export PATH=$PATH:$HOME/.cabal/bin
49         hoogle generate
50         popd
51     - name: Install JS Language Server
52       run: npm install javascript-typescript-langserver
53     - name: Build
54       run: cabal build
55     - name: Test
56       run: |
57         export PATH=$PATH:$HOME/.cabal/bin:$(npm bin) 
58         cabal test