Skip to content

Commit

Permalink
Add rust format workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lemaitre-aneo committed Nov 4, 2024
1 parent a08dcc0 commit 37b535b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,43 @@ jobs:
- name: Check Diff
run: docker run --rm --volume "$(pwd)/Protos/V1:/workspace" --workdir /workspace bufbuild/buf:1.8.0 format -d --exit-code

format-rust:
name: Format and check Rust
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- nightly
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/rust/armonik
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- uses: taiki-e/install-action@v2
with:
tool: protoc,sccache
- name: Install toolchain
if: ${{ !contains(matrix.toolchain, 'nightly') }}
uses: dtolnay/rust-toolchain@stable
with:
components: rust-src,rust-docs,rustfmt,clippy
- name: Build
run: |
cargo build --all --locked
- name: Format
run: |
cargo fmt --all --check
- name: Doc
run: |
RUSTDOCFLAGS="-Dwarnings" cargo doc
- name: Clippy
run: |
cargo clippy --all --no-deps -- -Dwarnings -Dunused-crate-dependencies
lint-js:
name: Lint JS
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
"rust-analyzer.linkedProjects": [
"./packages/rust/armonik/Cargo.toml"
]
}
}
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default antfu({
'.docs',
'packages/csharp',
'packages/cpp',
'packages/rust',
],
}).overrideRules({
'antfu/consistent-list-newline': 'off',
Expand Down

0 comments on commit 37b535b

Please sign in to comment.