mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-11 15:17:42 +00:00
build: Move cargo fmt check to nightly toolchain via new workflow
Enforcing group_imports="StdExternalCrate" requires using cargo fmt from the nightly toolchain. Create a new workflow that runs on nightly to run cargo fmt. Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
This commit is contained in:
parent
f041c940a7
commit
9013d8b4ca
.github/workflows
32
.github/workflows/formatting.yaml
vendored
Normal file
32
.github/workflows/formatting.yaml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
name: Cloud Hypervisor Code Formatting
|
||||
on: [pull_request, merge_group]
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Code Formatting
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
rust:
|
||||
- nightly
|
||||
target:
|
||||
- x86_64-unknown-linux-gnu
|
||||
- aarch64-unknown-linux-musl
|
||||
env:
|
||||
RUSTFLAGS: -D warnings
|
||||
steps:
|
||||
- name: Code checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Install Rust toolchain (${{ matrix.rust }})
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
target: ${{ matrix.target }}
|
||||
components: rustfmt
|
||||
- name: Formatting (rustfmt)
|
||||
run: cargo fmt --all -- --check
|
||||
- name: Formatting (fuzz) (rustfmt)
|
||||
run: cargo fmt --all --manifest-path fuzz/Cargo.toml -- --check
|
10
.github/workflows/quality.yaml
vendored
10
.github/workflows/quality.yaml
vendored
@ -6,7 +6,7 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Quality (clippy, rustfmt)
|
||||
name: Quality (clippy)
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: ${{ matrix.experimental }}
|
||||
strategy:
|
||||
@ -39,7 +39,7 @@ jobs:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
target: ${{ matrix.target }}
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
components: clippy
|
||||
|
||||
- name: Bisectability Check (default features)
|
||||
if: ${{ github.event_name == 'pull_request' && matrix.target == 'x86_64-unknown-linux-gnu' }}
|
||||
@ -49,12 +49,6 @@ jobs:
|
||||
for commit in $commits; do git checkout $commit; cargo check --tests --examples --all --target=${{ matrix.target }}; done
|
||||
git checkout ${{ github.sha }}
|
||||
|
||||
- name: Formatting (rustfmt)
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
- name: Formatting (fuzz) (rustfmt)
|
||||
run: cargo fmt --all --manifest-path fuzz/Cargo.toml -- --check
|
||||
|
||||
- name: Clippy (kvm)
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
|
Loading…
Reference in New Issue
Block a user