From c32959261e6bcc3a8be2889f84b46fe70db4dbd9 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Tue, 8 Dec 2020 09:39:06 -0800 Subject: [PATCH] gh: Expand clippy tests to cover the mshv feature Since we can't test mshv and kvm at the same time, --all-features no longer work. We factorize all, non-hypervisor related features into a common set and mix that with either mshv and kvm. Co-Developed-by: Samuel Ortiz Signed-off-by: Samuel Ortiz Co-Developed-by: Wei Liu Signed-off-by: Wei Liu Signed-off-by: Muminul Islam --- .github/workflows/quality.yaml | 27 ++++++++++++++++++--------- Cargo.toml | 2 ++ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index 82fffb136..5d74d1992 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -18,19 +18,28 @@ jobs: - name: Install Rust toolchain (${{ matrix.rust }}) uses: actions-rs/toolchain@v1 with: - toolchain: ${{ matrix.rust }} - target: ${{ matrix.target }} - override: true - components: rustfmt, clippy - + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + components: rustfmt, clippy + - name: Formatting (rustfmt) run: cargo fmt -- --check - - name: Clippy (all features) - run: cargo clippy --all --all-targets --all-features --tests -- -D warnings - + - name: Clippy (all features,kvm) + run: cargo clippy --all --all-targets --no-default-features --tests --features "common,kvm" -- -D warnings + + - name: Clippy (all features,mshv) + run: cargo clippy --all --all-targets --no-default-features --tests --features "common,mshv" -- -D warnings + - name: Clippy (acpi,kvm) run: cargo clippy --all --all-targets --no-default-features --tests --features "acpi,kvm" -- -D warnings - + - name: Clippy (kvm) run: cargo clippy --all --all-targets --no-default-features --tests --features "kvm" -- -D warnings + + - name: Clippy (acpi,mshv) + run: cargo clippy --all --all-targets --no-default-features --tests --features "acpi,mshv" -- -D warnings + + - name: Clippy (mshv) + run: cargo clippy --all --all-targets --no-default-features --tests --features "mshv" -- -D warnings diff --git a/Cargo.toml b/Cargo.toml index 98dc62466..efeb342b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,6 +48,8 @@ net_util = { path = "net_util" } [features] default = ["acpi", "cmos", "io_uring", "kvm"] +# Common features for all hypervisors +common = ["acpi", "cmos", "fwdebug", "io_uring"] acpi = ["vmm/acpi"] cmos = ["vmm/cmos"] fwdebug = ["vmm/fwdebug"]