From a4b67c2226768b1bb331bb5c0391d901044c1246 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 13 Aug 2020 12:00:48 +0100 Subject: [PATCH] build: Use GitHub actions for clippy/build/rustfmt tests Signed-off-by: Rob Bradford --- .github/workflows/build.yaml | 14 +++++++++++- .github/workflows/quality.yaml | 39 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/quality.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f874370c6..9589a1098 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -25,5 +25,17 @@ jobs: target: ${{ matrix.target }} override: true - - name: Build + - name: Debug Build (default features) + run: cargo build --all --target=${{ matrix.target }} + + - name: Build (pci,acpi,kvm) + run: cargo rustc --bin cloud-hypervisor --no-default-features --features "pci,acpi,kvm" -- -D warnings + + - name: Build (pci,kvm) + run: cargo rustc --bin cloud-hypervisor --no-default-features --features "pci,kvm" -- -D warnings + + - name: Build (mmio,kvm) + run: cargo rustc --bin cloud-hypervisor --no-default-features --features "mmio,kvm" -- -D warnings + + - name: Release Build (default features) run: cargo build --all --release --target=${{ matrix.target }} diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml new file mode 100644 index 000000000..9f92a9f1c --- /dev/null +++ b/.github/workflows/quality.yaml @@ -0,0 +1,39 @@ +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 + strategy: + matrix: + rust: + - stable + target: + - x86_64-unknown-linux-gnu + steps: + - name: Code checkout + uses: actions/checkout@v2 + - 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 (all features) + run: cargo clippy --all-targets --all-features -- -D warnings + + - name: Clippy (pci,acpi,kvm) + run: cargo clippy --all-targets --no-default-features --features "pci,acpi,kvm" -- -D warnings + + - name: Clippy (pci,kvm) + run: cargo clippy --all-targets --no-default-features --features "pci,kvm" -- -D warnings + + - name: Clippy (mmio,kvm) + run: cargo clippy --all-targets --no-default-features --features "mmio,kvm" -- -D warnings \ No newline at end of file