Squashed commit of the following:
[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: Cache Hoogle
45       uses: actions/cache@v1.1.0
46       with:
47         path: ~/.hoogle
48         key: ${{ runner.OS }}-${{ matrix.ghc }}-hoogle-${{ env.hieref }}
49
50     - name: Build HIE
51       run: |
52         pushd ../haskell-ide-engine
53         cabal install hie
54         cabal install hoogle
55         popd
56     - name: Generate hoogle database
57       run: |
58         if [ -d $HOME/.hoogle ]; then
59            echo "hoogle database already built"
60            exit 0
61         fi
62         hoogle generate
63     - name: Install JS Language Server
64       run: npm install javascript-typescript-langserver
65     - name: Build
66       run: cabal build
67     - name: Test
68       run: |
69         export PATH=$PATH:$(npm bin) 
70         cabal test