Skip to content

Commit dfbff4d

Browse files
committed
ci: add check rust formating github workflow
Signed-off-by: Ruowen Qin <ruowenq2@illinois.edu>
1 parent 8fd0608 commit dfbff4d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/rustfmt.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Formatting check
2+
3+
on:
4+
push:
5+
branches: [main, ci]
6+
paths-ignore:
7+
- docs/**
8+
- tools/**
9+
- README.md
10+
pull_request:
11+
branches: [main]
12+
paths-ignore:
13+
- docs/**
14+
- tools/**
15+
- README.md
16+
17+
jobs:
18+
formatting:
19+
if: github.repository == 'rex-rs/rex'
20+
name: cargo fmt
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: switch rust nightly
25+
run: rustup default nightly
26+
- name: formatting rex code
27+
run: cargo fmt
28+
- name: formatting samples code
29+
run: |
30+
for d in $(find ./samples -name Cargo.toml); do
31+
echo "→ Processing $d"
32+
cargo fmt --manifest-path $d --verbose --check
33+
done

0 commit comments

Comments
 (0)