From 0750a9ba08c4b326866bb49368846629992eb32b Mon Sep 17 00:00:00 2001 From: Jack Hodgkinson <30505104+jhodgdev@users.noreply.github.com> Date: Mon, 14 Feb 2022 10:49:22 +0000 Subject: [PATCH] Integrate lint and format --- .github/workflows/integrate.yaml | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index b3c364f..70ee951 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -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: