2020-04-23 12:59:18 +02:00
|
|
|
name: Cloud Hypervisor Build
|
2020-03-12 10:03:27 +01:00
|
|
|
on: [pull_request, create]
|
2020-03-05 12:16:51 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2020-03-12 10:03:27 +01:00
|
|
|
if: github.event_name == 'pull_request'
|
2020-03-05 12:16:51 +01:00
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
2020-03-13 10:45:50 +01:00
|
|
|
strategy:
|
2020-12-07 10:24:59 +00:00
|
|
|
fail-fast: false
|
2020-03-13 10:45:50 +01:00
|
|
|
matrix:
|
|
|
|
rust:
|
|
|
|
- stable
|
|
|
|
- beta
|
2020-06-12 18:56:53 +01:00
|
|
|
- nightly
|
2023-01-26 08:01:04 +00:00
|
|
|
- "1.62"
|
2020-04-20 08:07:17 +02:00
|
|
|
target:
|
|
|
|
- x86_64-unknown-linux-gnu
|
|
|
|
- x86_64-unknown-linux-musl
|
2020-03-05 12:16:51 +01:00
|
|
|
steps:
|
|
|
|
- name: Code checkout
|
|
|
|
uses: actions/checkout@v2
|
2020-10-06 10:52:06 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2022-02-10 18:29:53 -08:00
|
|
|
- name: Install musl-gcc
|
|
|
|
run: sudo apt install -y musl-tools
|
|
|
|
|
2020-03-13 10:45:50 +01:00
|
|
|
- name: Install Rust toolchain (${{ matrix.rust }})
|
2020-03-05 12:16:51 +01:00
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-08-11 12:31:57 +01:00
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
override: true
|
2020-08-13 12:00:48 +01:00
|
|
|
|
2022-03-28 11:19:09 +01:00
|
|
|
- name: Build (default features)
|
2022-04-19 10:15:46 +00:00
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor -- -D warnings
|
2021-09-07 14:28:58 +00:00
|
|
|
|
2022-09-26 17:02:18 +01:00
|
|
|
- name: Build (kvm)
|
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor --no-default-features --features "kvm" -- -D warnings
|
2021-09-07 14:28:58 +00:00
|
|
|
|
2022-03-28 11:19:09 +01:00
|
|
|
- name: Build (default features + tdx)
|
2022-04-19 10:15:46 +00:00
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor --features "tdx" -- -D warnings
|
2022-03-25 11:53:21 -07:00
|
|
|
|
2022-05-24 10:46:27 +08:00
|
|
|
- name: Build (default features + guest_debug)
|
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor --features "guest_debug" -- -D warnings
|
|
|
|
|
2022-09-26 17:02:18 +01:00
|
|
|
- name: Build (mshv)
|
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor --no-default-features --features "mshv" -- -D warnings
|
2022-03-28 11:19:09 +01:00
|
|
|
|
2022-09-26 17:02:18 +01:00
|
|
|
- name: Build (mshv + kvm)
|
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor --no-default-features --features "mshv,kvm" -- -D warnings
|
2022-07-20 23:59:24 +00:00
|
|
|
|
2020-08-13 12:00:48 +01:00
|
|
|
- name: Release Build (default features)
|
2022-04-19 10:15:46 +00:00
|
|
|
run: cargo build --locked --all --release --target=${{ matrix.target }}
|
2021-06-18 15:52:49 +01:00
|
|
|
|
|
|
|
- name: Check build did not modify any files
|
|
|
|
run: test -z "$(git status --porcelain)"
|