summaryrefslogtreecommitdiff
path: root/.github/workflows/haskell.yml
blob: 4f3e0e871c0a486830a69ea698b1d73550526be8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Haskell CI

on:
  push: ~
  pull_request:
    branches: [master]

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-haskell@v1
      with:
        enable-stack: true
        stack-no-global: true
        stack-version: latest

    - name: Cache
      uses: actions/cache@v2
      with:
        path: |
          ~/.stack
          graphql.cabal
          stack.yaml.lock
        key: ${{ runner.os }}-test-${{ hashFiles('**/stack.yaml') }}
        restore-keys: ${{ runner.os }}-test-

    - name: Install dependencies
      run: stack --no-terminal test --only-snapshot
    - name: Run tests
      run: stack --no-terminal test --pedantic
    - name: Build the documentation
      run: |
        stack --no-terminal ghc -- -Wall -Werror -fno-code docs/tutorial/tutorial.lhs
        stack --no-terminal haddock --no-haddock-deps

  lint:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-haskell@v1
      with:
        enable-stack: true
        stack-no-global: true
        stack-version: latest

    - name: Cache
      uses: actions/cache@v2
      with:
        path: |
          ~/.stack
          graphql.cabal
          stack.yaml.lock
        key: ${{ runner.os }}-lint-${{ hashFiles('**/stack.yaml') }}
        restore-keys: ${{ runner.os }}-lint-

    - name: Build HLint
      run: stack --no-terminal build hlint
    - name: Install HLint
      run: stack --no-terminal install hlint
    - name: Lint
      run: stack --no-terminal exec hlint -- src tests docs