ci: Don't auto-install cargo-sort in xtask

This commit is contained in:
Jonas Platte 2021-05-15 15:44:47 +02:00
parent 9e9696f091
commit 3878476317
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
2 changed files with 4 additions and 7 deletions

View File

@ -20,6 +20,10 @@ jobs:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Install cargo-sort
uses: actions-rs/install@v0.1
with:
crate: cargo-sort
- name: Run checks
uses: actions-rs/cargo@v1
with:

View File

@ -55,13 +55,6 @@ impl CiTask {
fn build_nightly(&self) -> xshell::Result<()> {
let fmt_res = cmd!("rustup run nightly cargo fmt -- --check").run();
let clippy_res = cmd!("rustup run nightly cargo ruma-clippy -D warnings").run();
let already_installed = cmd!("rustup run nightly cargo sort -V")
.read()
.map_or(false, |stdout| !stdout.contains("error"));
if !already_installed {
cmd!("rustup run nightly cargo install cargo-sort").run()?;
}
let sort_res = cmd!("cargo sort --workspace --grouped --check").run();
fmt_res.and(clippy_res).and(sort_res)