Merge branch '8.8.1-ci' of https://github.com/bubba/lsp-test into 8.8.1-ci
[lsp-test.git] / .github / workflows / haskell.yml
1 name: Haskell CI
2
3 on: [push, pull_request]
4 jobs:
5   build:
6    
7     runs-on: ${{ matrix.os }}
8
9     env:
10       hieref: 970637fa13ef29ccc3c0a977248fcea83bdd11d7
11
12     strategy:
13       matrix:
14         ghc: ['8.8.1', '8.6.5', '8.4.4']
15         os: [ubuntu-latest, macOS-latest]
16         exclude:
17           - os: macOS-latest
18             ghc: '8.4.4' # fails due to ghc panic
19
20     steps:
21     - uses: actions/checkout@v1
22     - uses: bubba/setup-haskell@macos-ghcup
23       with:
24         ghc-version: ${{ matrix.ghc }}
25         cabal-version: '3.0'
26
27     - name: Clone HIE
28       uses: actions/checkout@v1
29       with:
30         repository: haskell/haskell-ide-engine
31         submodules: recursive
32         ref: ${{ env.hieref }}
33         path: haskell-ide-engine
34
35     - name: Cache Cabal
36       uses: actions/cache@v1.1.0
37       with:
38         path: ~/.cabal
39         key: ${{ runner.OS }}-${{ matrix.ghc }}-cabal-${{ env.hieref }}
40         restore-keys: |
41           ${{ runner.OS }}-${{ matrix.ghc }}-cabal
42
43     - name: Cache Hoogle
44       uses: actions/cache@v1.1.0
45       with:
46         path: ~/.hoogle
47         key: ${{ runner.OS }}-${{ matrix.ghc }}-hoogle-${{ env.hieref }}
48
49     - run: cabal update
50
51     - name: Build HIE
52       run: |
53         pushd ../haskell-ide-engine
54         cabal install hie
55         cabal install hoogle
56         popd
57     - name: Generate hoogle database
58       run: |
59         if [ -d $HOME/.hoogle ]; then
60            echo "hoogle database already built"
61            exit 0
62         fi
63         hoogle generate
64     - name: Install JS Language Server
65       run: npm install javascript-typescript-langserver
66     - name: Build
67       run: cabal build
68     - name: Test
69       run: |
70         export PATH=$PATH:$(npm bin) 
71         cabal test