Turn on Haskell workflow for PRs
[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: cd0d1eb88334c359b8a220f2aebec703d66012ff
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: mpickering/haskell-ide-engine
29         submodules: recursive
30         ref: ${{ env.hieref }}
31         path: haskell-ide-engine
32
33     # - name: Cache Cabal
34     #   uses: actions/cache@v1
35     #   with:
36     #     path: ~/.cabal
37     #     key: ${{ runner.OS }}-${{ matrix.ghc }}-cabal-${{ hashFiles('../**/*.cabal') }}
38     #     restore-keys: |
39     #       ${{ runner.OS }}-${{ matrix.ghc }}-cabal
40
41     - name: Build HIE
42       run: |
43         # if [ -e $HOME/.cabal/bin/hie ]; then
44         #     echo "hie is already built"
45         #     exit 0
46         # fi
47         pushd ../haskell-ide-engine
48         cabal install hie
49         cabal install hoogle
50         hoogle generate
51         popd
52     - name: Install JS Language Server
53       run: npm install -g javascript-typescript-langserver
54     - name: Build
55       run: cabal build
56     - name: Test
57       run: |
58         echo $PATH
59         echo $(npm bin)
60         export PATH=$PATH:$(npm bin) 
61         cabal test