-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (90 loc) · 2.48 KB
/
ci.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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup nix
uses: cachix/install-nix-action@v25
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
- name: Check
run: nix flake check
- name: Build
run: |
cd test
nix build
- name: Dev shell (ormolu)
run: |
cd test
nix develop -c bash -c "cabal build && ormolu --version"
- name: Dev shell (fourmolu)
run: |
cd test
nix develop -c bash -c "cabal build && fourmolu --version"
- name: Dev shell (nixpkgs-fmt)
run: |
cd test
# nixpkgs-fmt --help/version returns exit code 1 for some reason...
nix develop .#nixpkgs-fmt -c bash -c "which nixpkgs-fmt"
- name: Dev shell (nixfmt)
run: |
cd test
nix develop .#nixfmt -c bash -c "nixfmt --version"
- name: Format (ormolu)
run: |
cd test
nix run .#format
git diff --exit-code --no-index src/Lib.hs Lib.ormolu
- name: Format (fourmolu)
run: |
cd test
nix run .#format-fourmolu
git diff --exit-code --no-index src/Lib.hs Lib.fourmolu
- name: Format (find)
run: |
cd test
nix run .#format-find
git diff --exit-code --no-index src/Lib.hs Lib.ormolu
- name: FormatHs
run: |
cd test
nix run .#formatHs
git diff --exit-code --no-index src/Lib.hs Lib.ormolu
- name: Format (nixpkgs-fmt)
run: |
cd test
git checkout .
nix run .#format-nixpkgs-fmt
git diff --exit-code --no-index nix/test.nix nix/test-nixpkgs-fmt
- name: Format (nixfmt)
run: |
cd test
git checkout .
nix run .#format-nixfmt
git diff --exit-code --no-index nix/test.nix nix/test-nixfmt
- name: Lint
run: |
cd test
nix run .#lint
- name: Lint (find)
run: |
cd test
nix run .#lint-find
- name: LintRefactor
run: |
cd test
nix run .#lintRefactor
- name: LintRefactor (find)
run: |
cd test
nix run .#lintRefactor-find