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