-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (46 loc) · 1.41 KB
/
validate.yml
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
name: code validation
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
permissions:
contents: read
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: freckle/stack-action@v5
with:
stack-build-arguments: ""
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: changed-files
uses: tj-actions/changed-files@v45
with:
files: "**/*.hs"
- uses: haskell-actions/hlint-setup@v2
- if: steps.changed-files.outputs.all_changed_and_modified_files
uses: haskell-actions/hlint-run@v2
with:
path: ${{ toJSON(steps.changed-files.all_changed_and_modified_files) }}
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: changed-files
uses: tj-actions/changed-files@v45
with:
files: "**/*.hs"
- if: steps.changed-files.outputs.all_changed_and_modified_files
env:
TARGETS: ${{ steps.changed-files.outputs.all_changed_and_modified_files }}
run: |
curl -sL https://raw.github.com/haskell/stylish-haskell/master/scripts/latest.sh | sh -s .
stylish-haskell -i $TARGETS
for f in $(git diff --name-only --diff-filter=M); do
echo "::error file=$f::File is not formatted properly."
done