Skip to content

Commit 33c8a30

Browse files
ci: add rust-style CI workflow
Run `cargo fmt --all --check` on every pull request to enforce the project's rustfmt.toml. Installs nightly rustfmt explicitly since rustfmt.toml sets `unstable_features = true`. Per-PR concurrency group cancels superseded runs. Signed-off-by: Nikola Pajkovsky <nikolap@openssl.org>
1 parent 8022962 commit 33c8a30

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/rust-style.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Rust Style
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
concurrency:
10+
group: rust-style-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
rustfmt:
15+
if: github.repository == 'bcgit/bc-rust'
16+
name: rustfmt
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Install nightly rustfmt
23+
run: |
24+
rustup toolchain install nightly --profile minimal --component rustfmt
25+
rustup override set nightly
26+
27+
- name: Check formatting
28+
run: cargo fmt --all --check

0 commit comments

Comments
 (0)