From 36e26f004c59861f854235496c6dd06a470a2d3d Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 22 Sep 2022 10:56:49 +0100 Subject: [PATCH] .github: Consolidate quality checks into single worklow Combine aarch64 and x86-64 checks into one workflow Signed-off-by: Rob Bradford --- .github/workflows/quality-aarch64.yaml | 49 ---------------------- .github/workflows/quality.yaml | 57 ++++++++++++++++++++++---- 2 files changed, 50 insertions(+), 56 deletions(-) delete mode 100644 .github/workflows/quality-aarch64.yaml diff --git a/.github/workflows/quality-aarch64.yaml b/.github/workflows/quality-aarch64.yaml deleted file mode 100644 index 5680e8a61..000000000 --- a/.github/workflows/quality-aarch64.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: Cloud Hypervisor Quality Checks -on: [pull_request, create] - -jobs: - build: - if: github.event_name == 'pull_request' - name: Quality (clippy, rustfmt) - runs-on: ubuntu-latest - continue-on-error: ${{ matrix.experimental }} - strategy: - fail-fast: false - matrix: - rust: - - stable - target: - - aarch64-unknown-linux-gnu - experimental: [false] - include: - - rust: beta - target: aarch64-unknown-linux-gnu - experimental: true - steps: - - name: Code checkout - uses: actions/checkout@v3 - - - name: Install Rust toolchain (${{ matrix.rust }}) - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.rust }} - target: ${{ matrix.target }} - override: true - components: rustfmt, clippy - - - name: Formatting (rustfmt) - run: cargo fmt -- --check - - - name: Clippy (common + kvm) - uses: actions-rs/cargo@v1 - with: - use-cross: true - command: clippy - args: --target=${{ matrix.target }} --tests --all --no-default-features --features "common,kvm" -- -D warnings - - - name: Clippy (default features) - uses: actions-rs/cargo@v1 - with: - use-cross: true - command: clippy - args: --target=${{ matrix.target }} --tests --all -- -D warnings diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index fff37f2a8..33c36817a 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -14,11 +14,15 @@ jobs: - stable target: - x86_64-unknown-linux-gnu + - aarch64-unknown-linux-gnu experimental: [false] include: - rust: beta target: x86_64-unknown-linux-gnu experimental: true + - rust: beta + target: aarch64-unknown-linux-gnu + experimental: true steps: - name: Code checkout uses: actions/checkout@v3 @@ -34,6 +38,7 @@ jobs: components: rustfmt, clippy - name: Debug Check (default features) + if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} run: | set -e commits=$(git rev-list origin/${{ github.base_ref }}..${{ github.sha }}) @@ -44,25 +49,63 @@ jobs: run: cargo fmt -- --check - name: Clippy (common + kvm) - run: cargo clippy --locked --all --all-targets --no-default-features --tests --features "common,kvm" -- -D warnings + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} + command: clippy + args: --locked --all --all-targets --no-default-features --tests --features "common,kvm" -- -D warnings - name: Clippy (default features) - run: cargo clippy --locked --all --all-targets --tests -- -D warnings + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} + command: clippy + args: --locked --all --all-targets --tests -- -D warnings - name: Clippy (default features + gdb) - run: cargo clippy --locked --all --all-targets --tests --features "gdb" -- -D warnings + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} + command: clippy + args: --locked --all --all-targets --tests --features "gdb" -- -D warnings - name: Clippy (default features + guest_debug) - run: cargo clippy --locked --all --all-targets --tests --features "guest_debug" -- -D warnings + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} + command: clippy + args: --locked --all --all-targets --tests --features "guest_debug" -- -D warnings - name: Clippy (default features + tracing) - run: cargo clippy --locked --all --all-targets --tests --features "tracing" -- -D warnings + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} + command: clippy + args: --locked --all --all-targets --tests --features "tracing" -- -D warnings - name: Clippy (common + mshv) - run: cargo clippy --locked --all --all-targets --no-default-features --tests --features "common,mshv" -- -D warnings + if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} + command: clippy + args: --locked --all --all-targets --no-default-features --tests --features "common,mshv" -- -D warnings - name: Clippy (common + mshv + kvm) - run: cargo clippy --locked --all --all-targets --no-default-features --tests --features "common,mshv,kvm" -- -D warnings + if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} + command: clippy + args: --locked --all --all-targets --no-default-features --tests --features "common,mshv,kvm" -- -D warnings + + - name: Clippy (common + kvm + tdx) + if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} + uses: actions-rs/cargo@v1 + with: + use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }} + command: clippy + args: --locked --all --all-targets --no-default-features --tests --features "common,tdx,kvm" -- -D warnings - name: Check build did not modify any files run: test -z "$(git status --porcelain)"