Skip to content

Commit 7bcbfef

Browse files
committed
ci: Add rustfmt workflow
Based on slog CI config
1 parent b3b50ff commit 7bcbfef

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/rustfmt.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# The file is the workflow for rustfmt
2+
#
3+
# It runs `cargo fmt --check`
4+
#
5+
# It will fail if there are formatting problems.
6+
on: [push, pull_request]
7+
name: rustfmt
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
rustfmt:
14+
# Only run on PRs if the source branch is on someone else's repo
15+
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: dtolnay/rust-toolchain@stable
20+
with:
21+
components: rustfmt
22+
- shell: bash
23+
run: |
24+
cargo fmt -- --check

0 commit comments

Comments
 (0)