Integrate lint and format

This commit is contained in:
Jack Hodgkinson 2022-02-14 10:49:22 +00:00
parent f4ac4f3bb2
commit 0750a9ba08

View file

@ -7,6 +7,7 @@ on:
- "agora.cabal"
branches:
- master
- staging
pull_request:
paths:
- "**.hs"
@ -14,6 +15,42 @@ on:
- "flake.lock"
- "agora.cabal"
jobs:
check-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2.1.4
name: Cache Stack
with:
path: ~/.stack
key: ${{ runner.os }}-stack-formatting
restore-keys: ${{ runner.os }}-stack-
- run: stack install fourmolu
name: Setup
- run: ./.github/format.sh
name: "Run fourmolu"
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2.1.4
name: Cache Stack
with:
path: ~/.stack
key: ${{ runner.os }}-stack-lint
restore-keys: ${{ runner.os }}-stack-
- run: stack install hlint
name: Setup
- run: ~/.local/bin/hlint $(git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs')
name: Lint
build:
runs-on: ubuntu-latest
steps: