-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (85 loc) · 2.12 KB
/
CI.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: "CI for haskell-ffprobe"
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
release:
types: [ published ]
defaults:
run:
shell: bash
jobs:
Changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
sources: ${{ steps.filter.outputs.sources }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
sources:
- 'src/**'
- 'test/**.hs'
- '.github/workflows/CI.yml'
Build:
needs: changes
if: ${{ needs.changes.outputs.sources == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Setup GHC
uses: ./.github/actions/cache
- name: Build
run: stack build
Format:
if: ${{ needs.changes.outputs.sources == 'true' }}
runs-on: ubuntu-latest
needs: [ Build ]
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Setup GHC
uses: ./.github/actions/cache
- uses: haskell-actions/run-fourmolu@v9
with:
version: "0.14.0.0"
pattern: |
./src/**/*.hs
./test/**/*.hs
follow-symbolic-links: false
Lint:
if: ${{ needs.changes.outputs.sources == 'true' }}
runs-on: ubuntu-latest
needs: [ Build ]
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Setup GHC
uses: ./.github/actions/cache
- name: 'Set up HLint'
uses: rwe/actions-hlint-setup@v1
with:
version: '3.5'
- name: 'Run HLint'
uses: rwe/actions-hlint-run@v2
with:
path: '["./src/", "./test/"]'
fail-on: warning
Tests:
runs-on: ubuntu-latest
needs: [ Build ]
if: ${{ needs.changes.outputs.sources == 'true' }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Setup GHC
uses: ./.github/actions/cache
- name: Run unit tests
run: stack test