Skip to content

Commit b9b1b6f

Browse files
committed
add GH Action rustfmt --check workflow
1 parent 0c5b845 commit b9b1b6f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/fmt.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
on: [push, pull_request]
2+
3+
name: Rust fmt check
4+
5+
jobs:
6+
check:
7+
name: rustfmt
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout source
11+
- uses: actions/checkout@v2
12+
- name: Run rustfmt
13+
run: |
14+
rustup component add rustfmt
15+
cargo fmt --version
16+
cargo fmt -- --check || (echo "Please reformat your code with 'cargo fmt' (version $(cargo fmt --version))"; false)

0 commit comments

Comments
 (0)