mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
9013d8b4ca
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>
33 lines
915 B
YAML
33 lines
915 B
YAML
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
|