-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Lint | ||
|
||
# Trigger the workflow on push or pull request, but only for the master branch | ||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' | ||
|
||
- name: Check code is formatted using Ormolu | ||
run: | | ||
curl -L https://github.com/tweag/ormolu/releases/download/0.7.2.0/ormolu-Linux.zip -o ormolu.zip | ||
unzip ormolu.zip | ||
git ls-files | grep \.hs | xargs ./ormolu --mode=inplace | ||
if [[ $(git diff --stat) != '' ]]; then | ||
echo "Lint stage failed, running ormolu has returned changes" | ||
echo "$(git diff)" | ||
exit 1 | ||
else | ||
echo "Lint stage succeeded" | ||
exit 0 | ||
fi |