cloud-hypervisor/.github/workflows/build.yaml
Wei Liu ac32b1e35f ci: use cargo check to validate building commits
The purpose of that step is to make sure each commit builds. The `check`
command is much faster for that purpose.

On my 32-core machine `cargo check --all` takes around 25 seconds while
`cargo build --all` takes around 35 seconds, so that's quite a bit of
time saving there.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
2020-10-07 14:26:32 +02:00

47 lines
1.4 KiB
YAML

name: Cloud Hypervisor Build
on: [pull_request, create]
jobs:
build:
if: github.event_name == 'pull_request'
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
steps:
- name: Code checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Rust toolchain (${{ matrix.rust }})
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- name: Debug Check (default features)
run: |
git rev-list origin/master..$GITHUB_SHA | xargs -t -I % sh -c 'git checkout %; cargo check --all --target=${{ matrix.target }}'
git checkout $GITHUB_SHA
- 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 }}