-
-
Notifications
You must be signed in to change notification settings - Fork 142
36 lines (31 loc) · 1.08 KB
/
rustfmt.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
name: Rust format check
on: [push, pull_request]
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache toolchain
id: cache-toolchain
uses: actions/cache@v3
env:
cache-name: cache-toolchain
with:
path: |
~/.cargo
~/.rustup
~/.bashrc
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('.github/workflows/rustfmt.yml') }}
- if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }}
name: Install nightly-2023-01-21
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2023-01-21
override: true
components: rustfmt, clippy
- name: Check format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check