build: Use GitHub actions for clippy/build/rustfmt tests

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2020-08-13 12:00:48 +01:00 committed by Sebastien Boeuf
parent aa57762c4f
commit a4b67c2226
2 changed files with 52 additions and 1 deletions

View File

@ -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 }}

39
.github/workflows/quality.yaml vendored Normal file
View File

@ -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