Check for hie already existing
[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: 8582a960dc1ca389734707f821b273b00bae54ab
11
12     strategy:
13       matrix:
14         ghc: ['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     - run: cabal update
27
28     - name: Clone HIE
29       uses: actions/checkout@v1
30       with:
31         repository: haskell/haskell-ide-engine
32         submodules: recursive
33         ref: ${{ env.hieref }}
34         path: haskell-ide-engine
35
36     - name: Cache Cabal
37       uses: actions/cache@v1.1.0
38       with:
39         path: ~/.cabal
40         key: ${{ runner.OS }}-${{ matrix.ghc }}-cabal-${{ env.hieref }}
41         restore-keys: |
42           ${{ runner.OS }}-${{ matrix.ghc }}-cabal
43
44     - name: Build HIE
45       run: |
46         if [ -e $HOME/.cabal/bin/hie ]; then
47             echo "hie is already built"
48             exit 0
49         fi
50         pushd ../haskell-ide-engine
51         cabal install hie
52         cabal install hoogle
53         popd
54     - name: Generate hoogle database
55       run: hoogle generate
56     - name: Install JS Language Server
57       run: npm install javascript-typescript-langserver
58     - name: Build
59       run: cabal build
60     - name: Test
61       run: |
62         echo $PATH
63         echo $(npm bin)
64         export PATH=$PATH:$(npm bin) 
65         cabal test