-
Notifications
You must be signed in to change notification settings - Fork 0
221 lines (220 loc) · 9.01 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
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
# 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
- uses: actions/setup-python@v5
with:
cache: pip
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- uses: jiro4989/setup-nim-action@v2
- uses: goto-bus-stop/setup-zig@v2
- uses: uncenter/setup-taplo@v1
- uses: actions/setup-go@v5
with:
go-version: stable
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- uses: dart-lang/setup-dart@v1
- uses: crystal-lang/install-crystal@v1
- uses: hasnep/[email protected]
- uses: denoland/setup-deno@v2
with:
deno-version: v1.x
- uses: taiki-e/install-action@just
- uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "5.1"
- uses: actions/setup-java@v4
with:
java-version: "21"
distribution: temurin
- uses: haskell-actions/setup@v2
with:
ghc-version: latest
cabal-version: latest
cabal-update: true
- uses: julia-actions/cache@v2
- 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: pyink
run: pipx install pyink && pyink --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: pycln
run: pipx install pycln && pycln --version
- name: auto-optional
run: pipx install auto-optional && auto-optional --help
- 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: alejandra
run: curl -sSLO https://github.com/kamadorueda/alejandra/releases/download/3.0.0/alejandra-x86_64-unknown-linux-musl && chmod a+x alejandra-x86_64-unknown-linux-musl && sudo mv alejandra-x86_64-unknown-linux-musl /usr/local/bin/alejandra && alejandra --version
- name: fprettify
run: pipx install fprettify && fprettify --version
- name: autoflake
run: pipx install autoflake && autoflake --version
- name: buf
run: sudo curl -sSL "https://github.com/bufbuild/buf/releases/download/v1.34.0/buf-$(uname -s)-$(uname -m)" -o "/usr/local/bin/buf" && sudo chmod +x "/usr/local/bin/buf" && buf --version
- run: npm i -g js-beautify
- name: css-beautify
run: css-beautify --version
- name: js-beautify
run: js-beautify --version
- name: html-beautify
run: html-beautify --version
- name: efmt
run: cargo install efmt && efmt --version
- name: golines
run: go install github.com/segmentio/golines@latest
- name: grain
run: sudo curl -L --output /usr/local/bin/grain https://github.com/grain-lang/grain/releases/download/grain-v0.6.4/grain-linux-x64 && sudo chmod +x /usr/local/bin/grain
- name: htmlbeautifier
run: gem install htmlbeautifier
- name: kdlfmt
run: cargo install kdlfmt
- name: kcl
run: go install kcl-lang.io/cli/cmd/kcl@latest
- name: typos
run: cargo install typos-cli
- name: xmllint
run: sudo apt-get install -y libxml2-utils && xmllint --version
- name: rubyfmt
run: (which brew && brew install rubyfmt) || echo "Brew is not setup"
- name: ormolu
run: sudo apt-get install -y ormolu && ormolu --version
# - name: ocp-indent
# run: sudo apt-get install -y ocp-indent && ocp-indent --version && wget https://raw.githubusercontent.com/OCamlPro/ocp-indent/master/.ocp-indent -O .ocp-indent
- name: run tests
run: cargo test
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --locked --lcov --output-path lcov.info
- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
slug: hougesen/mdsf