Skip to content

Commit

Permalink
ci(cargo-sort): check formatting and item order of Cargo.toml files
Browse files Browse the repository at this point in the history
  • Loading branch information
ROMemories committed Feb 23, 2024
1 parent e045c66 commit 1b19c7d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,29 @@ jobs:
- name: "rustdoc generation check"
run: cargo rustdoc -p riot-rs-embassy -- -D warnings

cargo-sort:
runs-on: ubuntu-latest

steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly

- name: rust cache
uses: Swatinem/rust-cache@v2

# The compiled binary should be cached.
# rust-sort does provide binary releases but the last release is outdated
# and buggy so we compile a more recent version ourselves.
# TODO: use the binary release if one gets published later
- name: Install rust-sort
run: cargo install --git=https://github.com/DevinR528/cargo-sort --rev 55ec89082466f6bb246d870a8d56d166a8e1f08b cargo-sort

- name: Check formatting and item order of Cargo.toml files
run: cargo sort --check --check-format --grouped --workspace

CI-success:
if: ${{ always() }}
runs-on: ubuntu-latest
Expand Down

0 comments on commit 1b19c7d

Please sign in to comment.