Repository navigation
59 lines (48 loc) · 1.79 KB
/
Copy pathcode-formatting-check.yaml
File metadata and controls
59 lines (48 loc) · 1.79 KB
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
name: Code Formatting Check
on:
push:
pull_request:
merge_group:
schedule: # Trigger a job on default branch at 4AM PST everyday
- cron: 0 11 * * *
concurrency:
group: ${{ github.workflow }}-${{ github.event.compare || github.head_ref || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
cargo-fmt:
name: .rs Formatting Check
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust Toolchain (Nightly)
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: nightly
components: rustfmt
- name: Run Cargo Format
run: cargo +nightly fmt --all -- --check
taplo-fmt:
name: .toml Formatting Check
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust Toolchain (Stable)
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: stable
# Using cache-cargo-install-action to cache the compiled binary.
# Once taplo ships a release with field-level `keys` matching, this can
# be simplified back to install-action with a normal version pin.
- name: Install taplo-cli from pinned revision b673b44d
uses: taiki-e/cache-cargo-install-action@9ee83daaa7b96a6fab930949ecf1122bba04a389 # v3.0.8
with:
tool: taplo-cli
git: https://github.com/tamasfe/taplo
rev: b673b44d
locked: true
env:
RUSTFLAGS: ""
- run: taplo fmt --check --diff
name: Check TOML files formatting