Try new setup-haskell
[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: d9d21fb0675280e20e837dbeb5715dab65e9c6be
11
12     strategy:
13       fail-fast: false
14       matrix:
15         ghc: ['8.8.3', '8.6.5', '8.4.4']
16         os: [ubuntu-latest, macOS-latest, windows-latest]
17         exclude:
18           - os: macOS-latest
19             ghc: '8.4.4' # fails due to ghc panic
20
21     steps:
22     - uses: actions/checkout@v1
23     - uses: actions/setup-haskell@v1.1
24       with:
25         ghc-version: ${{ matrix.ghc }}
26         cabal-version: '3.0'
27     - run: cabal update
28
29     - name: Clone HIE
30       uses: actions/checkout@v1
31       with:
32         repository: haskell/haskell-ide-engine
33         submodules: recursive
34         ref: ${{ env.hieref }}
35         path: haskell-ide-engine
36
37     - name: Cache Cabal
38       uses: actions/cache@v1.1.0
39       with:
40         path: ~/.cabal
41         key: ${{ runner.OS }}-${{ matrix.ghc }}-cabal-${{ env.hieref }}
42         restore-keys: |
43           ${{ runner.OS }}-${{ matrix.ghc }}-cabal
44
45     - name: Cache Hoogle
46       uses: actions/cache@v1.1.0
47       with:
48         path: ~/.hoogle
49         key: ${{ runner.OS }}-${{ matrix.ghc }}-hoogle-${{ env.hieref }}
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