-
Notifications
You must be signed in to change notification settings - Fork 26
46 lines (36 loc) · 1.18 KB
/
code-formatting-check.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
name: Code Formatting Check
on:
push:
pull_request:
merge_group:
schedule: # Trigger a job on default branch at 4AM PST everyday
- cron: 0 11 * * *
jobs:
cargo-fmt:
name: .rs Formatting Check
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust Toolchain (Nightly)
# Need to temporarily pin nightly used for fmt because of upstream bug: https://github.com/rust-lang/rustfmt/issues/6082, https://github.com/rust-lang/rustfmt/issues/6099
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-02-17
components: rustfmt
- name: Run Cargo Format
run: cargo +nightly-2024-02-17 fmt --all -- --check
taplo-fmt:
name: .toml Formatting Check
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust Toolchain (Stable)
uses: dtolnay/rust-toolchain@stable
- name: Install taplo-cli
uses: taiki-e/install-action@v2
with:
tool: taplo-cli
- run: taplo fmt --check --diff
name: Check TOML files formatting