Skip to content

Commit b3bc50d

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

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/rustfmt.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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: |
26+
rustup default nightly
27+
rustup component add rustfmt
28+
- name: formatting rex code
29+
run: cargo fmt
30+
- name: formatting samples code
31+
run: |
32+
for d in $(find ./samples -name Cargo.toml); do
33+
echo "→ Processing $d"
34+
cargo fmt --manifest-path $d --verbose --check
35+
done

0 commit comments

Comments
 (0)