-
Notifications
You must be signed in to change notification settings - Fork 0
231 lines (185 loc) · 6.93 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
name: validate
on:
push:
schedule:
- cron: "0 0 * * 1"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
lint:
name: lint
strategy:
matrix:
os:
- windows-latest
- macos-latest
- ubuntu-latest
# TODO: remove once macos-latest is upgraded to an arm machine
- macos-14
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: rustup toolchain install stable --profile minimal
- run: rustup component add rustfmt clippy
- run: cargo fetch
- run: cargo fmt -- --check --color always
- run: cargo clippy
test:
name: test
strategy:
matrix:
os:
- ubuntu-latest
node:
- 20
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
# gleam_format, mix_format
# NOTE: should be first since it is sometimes crashes (?)
- uses: erlef/setup-beam@v1
with:
otp-version: "26"
gleam-version: "1.0.0"
elixir-version: "1.16.1"
# ruff, sqlfluff, black, blue, yapf, autopep8
- uses: actions/setup-python@v5
with:
cache: "pip"
# biome, prettier, stylua, sql-formatter
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
# nimpretty
- uses: jiro4989/setup-nim-action@v1
# zigfmt
- uses: goto-bus-stop/setup-zig@v2
# taplo
- uses: uncenter/setup-taplo@v1
# shfmt, gofmt, gofumpt
- uses: actions/setup-go@v5
with:
go-version: "stable"
# rubocop
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
# dart_format
- uses: dart-lang/setup-dart@v1
# crystal_format
- uses: crystal-lang/install-crystal@v1
# roc_format
- uses: hasnep/[email protected]
# deno_fmt
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
# just_fmt
- uses: taiki-e/install-action@just
# ocamlformat
#- uses: ocaml/setup-ocaml@v2
# with:
# ocaml-compiler: "5.1"
# scalafmt
- uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
# fourmolo, hindent
- uses: haskell-actions/setup@v2
with:
ghc-version: "latest"
cabal-version: "latest"
cabal-update: true
- uses: julia-actions/cache@v1
- run: rustup toolchain install stable --profile minimal
- run: rustup component add rustfmt clippy
- name: juliaformatter.jl
run: |
julia -e 'import Pkg; Pkg.add("JuliaFormatter")'
- name: taplo
run: taplo --version
- name: ruff
run: pipx install ruff && ruff --version
- name: sqlfluff
run: pipx install sqlfluff && sqlfluff format --version
- name: biome
run: npx --yes @biomejs/biome --version
- name: prettier
run: npx --yes prettier --version
- name: nimpretty
run: nimpretty --version
- name: zig fmt
run: zig fmt --help
- name: gleam format
run: gleam format --help
- name: mix format
run: mix help format
- name: rubocop
run: gem install rubocop && rubocop --version
- name: stylua
run: cargo install stylua && stylua --version
- name: shfmt
run: go install mvdan.cc/sh/v3/cmd/shfmt@latest && shfmt --version
- name: gofumpt
run: go install mvdan.cc/gofumpt@latest && gofumpt --version
- name: black
run: pipx install black && black --version
- name: blue
run: pipx install blue && blue --version
- name: yapf
run: pipx install yapf && yapf --version
- name: autopep
run: pipx install autopep8 && autopep8 --version
- name: clang-format
run: pipx install clang-format && clang-format --version
- name: isort
run: pipx install isort && isort --version
- name: usort
run: pipx install usort && usort --version
#- name: ocamlformat
# run: eval $(opam env) && opam install ocamlformat && eval $(opam env) && ocamlformat --version
- name: blade-formatter
run: npx --yes blade-formatter --version
- name: crystal_format
run: crystal tool format --help
- name: perltidy
run: sudo apt-get install -y perltidy && perltidy --version
- name: goimports
run: go install golang.org/x/tools/cmd/goimports@latest && which goimports
- name: beautysh
run: pipx install beautysh && beautysh --version
- name: cljstyle
run: curl -sLO https://raw.githubusercontent.com/greglook/cljstyle/main/util/install-cljstyle && chmod +x install-cljstyle && sudo ./install-cljstyle && cljstyle version
- name: fourmolu
run: curl -sLO https://github.com/fourmolu/fourmolu/releases/download/v0.15.0.0/fourmolu-0.15.0.0-linux-x86_64 && chmod +x fourmolu-0.15.0.0-linux-x86_64 && sudo mv fourmolu-0.15.0.0-linux-x86_64 /usr/local/bin/fourmolu && fourmolu --version
- name: hindent
run: curl -sSLO https://github.com/mihaimaruseac/hindent/releases/download/v6.1.1/hindent && chmod a+x hindent && sudo mv hindent /usr/local/bin/ && hindent --version
- name: ktlint
run: curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.2.1/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/ && ktlint --version
- name: rufo
run: gem install rufo && rufo --version
- name: yamlfmt
run: go install github.com/google/yamlfmt/cmd/yamlfmt@latest && yamlfmt --version
- name: standardrb
run: gem install standardrb && standardrb --version
- name: fantomas
run: dotnet tool install -g fantomas && fantomas --version
- name: csharpier
run: dotnet tool install -g csharpier && dotnet csharpier --version
- name: xmlformatter/xmlformat
run: pipx install xmlformatter && which xmlformat
- name: yamlfix
run: pipx install yamlfix && yamlfix --version
- name: terraform
run: wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg && echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list && sudo apt update && sudo apt install terraform && terraform -version
- name: nixfmt
run: wget https://github.com/NixOS/nixfmt/releases/download/v0.6.0/nixfmt-x86_64-linux && chmod +x nixfmt-x86_64-linux && sudo cp nixfmt-x86_64-linux /usr/local/bin/nixfmt && nixfmt --version
- name: run tests
run: cargo test