aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/lint.yml
blob: da30f6c27ed4689ca3e7293c48bab053aea3f553 (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
name: Lint

# Trigger the workflow on push or pull request, but only for the
# master branch
on:
  pull_request:
    branch: [master]
  push:
    branch: [master]
    paths-ignore:
      - LICENSE
      - README.md
      - CHANGELOG.md
      - stack.yaml
      - .travis.yml

jobs:
  lint:
    name: Lint
    runs-on: ubuntu-latest
    env:
      hlint_script: https://raw.github.com/ndmitchell/hlint/master/misc/run.sh

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Check cabal file for missing test files
        run: |
          cabal sdist --list-only | sed 's/\.\///' | grep '^test\/' | \
            sort > sdist-test-files.txt
          git ls-tree -r --name-only HEAD | grep '^test\/' | \
            sort > git-test-files.txt
          diff -u git-test-files.txt sdist-test-files.txt

      - name: Download and run hlint
        run: |
          curl -sSL "${hlint_script}" | sh -s .