-
Notifications
You must be signed in to change notification settings - Fork 26
59 lines (54 loc) · 1.95 KB
/
Lint.yaml
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
52
53
54
55
56
57
58
59
on:
pull_request:
branches: main
workflow_dispatch:
paths: [code/drasil-**, .github/workflows/Lint.yaml, code/scripts/**]
name: Linter
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
working-directory: code
jobs:
linter:
name: "Linter"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Prepare more specific paths filters
- uses: dorny/paths-filter@v3.0.2
id: filter
with:
filters: |
hs:
- '**/*.hs'
- '**/*.lhs'
sh:
- '**/*.sh'
# If a [l]hs file was edited, then run HLint
# Once we update our LTS, we can remove this step, see "Inputs": https://github.com/haskell-actions/hlint-setup
- name: 'Install HLint system dependencies'
if: ${{ steps.filter.outputs.hs == 'true' }}
run: |
sudo apt-get update
sudo apt-get install -y libtinfo5
- name: 'Set up HLint'
if: ${{ steps.filter.outputs.hs == 'true' }}
uses: haskell-actions/hlint-setup@v2
with: # DO NOT MODIFY THE BELOW LINE MANUALLY -- code/scripts/update_default_stackage.sh is in charge of this!
version: '3.4.1' # HLINT VERSION TIED TO CURRENT TARGET (LTS-20.26)
- name: 'Run HLint'
if: ${{ steps.filter.outputs.hs == 'true' }}
uses: haskell-actions/hlint-run@v2
with: # The custom hlint-bin is necessary because we need to inject options to hlint, since hlint-run does not support it yet, see: https://github.com/haskell-actions/hlint-run/issues/20
hlint-bin: hlint --hint=code/.hlint.yaml
path: code/
fail-on: status
# If a sh script was edited, then run shellcheck
- name: "Run ShellCheck"
if: ${{ steps.filter.outputs.sh == 'true' }}
uses: ludeeus/action-shellcheck@2.0.0
with:
scandir: './code/scripts'