From a9fdaa67343d042d1fd639784505f8aad3cf5b34 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Mon, 28 Mar 2022 11:19:09 +0100 Subject: [PATCH] .github: Simplify feature testing in workflows This includes the removal of testing without the "acpi" feature. The command have been reordered to reduce the amount of recompilation required. Signed-off-by: Rob Bradford --- .github/workflows/build.yaml | 25 +++++++++++------------- .github/workflows/quality-aarch64.yaml | 18 ++--------------- .github/workflows/quality.yaml | 27 ++++++-------------------- 3 files changed, 19 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 96aa6c233..bd6689c15 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -38,24 +38,21 @@ jobs: git rev-list origin/main..$GITHUB_SHA | xargs -t -I % sh -c 'git checkout %; cargo check --all --target=${{ matrix.target }}' git checkout $GITHUB_SHA - - name: Build (default + tdx) + - name: Build (default features) + run: cargo rustc --bin cloud-hypervisor -- -D warnings + + - name: Build (common + kvm) + run: cargo rustc --bin cloud-hypervisor --no-default-features --features "common,kvm" -- -D warnings + + - name: Build (default features + tdx) run: cargo rustc --bin cloud-hypervisor --features "tdx" -- -D warnings - - name: Build (acpi,kvm) - run: cargo rustc --bin cloud-hypervisor --no-default-features --features "acpi,kvm" -- -D warnings - - - name: Build (kvm) - run: cargo rustc --bin cloud-hypervisor --no-default-features --features "kvm" -- -D warnings - - - name: Build (acpi,mshv) - run: cargo rustc --bin cloud-hypervisor --no-default-features --features "acpi,mshv" -- -D warnings - - - name: Build (mshv) - run: cargo rustc --bin cloud-hypervisor --no-default-features --features "mshv" -- -D warnings - - - name: Build (default + amx) + - name: Build (default features + amx) run: cargo rustc --bin cloud-hypervisor --features "amx" -- -D warnings + - name: Build (common + mshv) + run: cargo rustc --bin cloud-hypervisor --no-default-features --features "common,mshv" -- -D warnings + - name: Release Build (default features) run: cargo build --all --release --target=${{ matrix.target }} diff --git a/.github/workflows/quality-aarch64.yaml b/.github/workflows/quality-aarch64.yaml index c5c9f5e4c..7c48e8461 100644 --- a/.github/workflows/quality-aarch64.yaml +++ b/.github/workflows/quality-aarch64.yaml @@ -32,28 +32,14 @@ jobs: - name: Formatting (rustfmt) run: cargo fmt -- --check - - name: Clippy (kvm) - uses: actions-rs/cargo@v1 - with: - use-cross: true - command: clippy - args: --target=${{ matrix.target }} --all --no-default-features --features "kvm" -- -D warnings - - - name: Clippy (kvm,acpi) - uses: actions-rs/cargo@v1 - with: - use-cross: true - command: clippy - args: --target=${{ matrix.target }} --all --no-default-features --features "kvm,acpi" -- -D warnings - - - name: Clippy (all features,kvm) + - name: Clippy (common + kvm) uses: actions-rs/cargo@v1 with: use-cross: true command: clippy args: --target=${{ matrix.target }} --all --no-default-features --features "common,kvm" -- -D warnings - - name: Clippy (default) + - name: Clippy (default features) uses: actions-rs/cargo@v1 with: use-cross: true diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index cfe7b9446..57e871e0f 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -33,32 +33,17 @@ jobs: - name: Formatting (rustfmt) run: cargo fmt -- --check - - name: Clippy (all features,kvm) + - name: Clippy (common + 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 (default features) + run: cargo clippy --all --all-targets --tests -- -D warnings - - name: Clippy (acpi,kvm) - run: cargo clippy --all --all-targets --no-default-features --tests --features "acpi,kvm" -- -D warnings - - - name: Clippy (acpi,kvm,tdx) - run: cargo clippy --all --all-targets --no-default-features --tests --features "acpi,kvm,tdx" -- -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 - - - name: Clippy (default + amx) + - name: Clippy (default features + amx) run: cargo clippy --all --all-targets --tests --features "amx" -- -D warnings - - name: Clippy (integration tests) - run: cargo clippy --all --all-targets --tests -- -D warnings + - name: Clippy (common + mshv) + run: cargo clippy --all --all-targets --no-default-features --tests --features "common,mshv" -- -D warnings - name: Check build did not modify any files run: test -z "$(git status --porcelain)"