2020-04-23 10:59:18 +00:00
|
|
|
name: Cloud Hypervisor Build
|
2024-02-28 09:49:28 +00:00
|
|
|
on: [pull_request, merge_group]
|
2024-02-28 15:17:57 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2020-03-05 11:16:51 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
2020-03-13 09:45:50 +00:00
|
|
|
strategy:
|
2020-12-07 10:24:59 +00:00
|
|
|
fail-fast: false
|
2020-03-13 09:45:50 +00:00
|
|
|
matrix:
|
|
|
|
rust:
|
|
|
|
- stable
|
|
|
|
- beta
|
2020-06-12 17:56:53 +00:00
|
|
|
- nightly
|
2024-02-29 11:35:31 +00:00
|
|
|
- "1.74"
|
2020-04-20 06:07:17 +00:00
|
|
|
target:
|
|
|
|
- x86_64-unknown-linux-gnu
|
|
|
|
- x86_64-unknown-linux-musl
|
2020-03-05 11:16:51 +00:00
|
|
|
steps:
|
|
|
|
- name: Code checkout
|
2023-12-11 11:56:22 +00:00
|
|
|
uses: actions/checkout@v4
|
2020-10-06 08:52:06 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2022-02-11 02:29:53 +00:00
|
|
|
- name: Install musl-gcc
|
|
|
|
run: sudo apt install -y musl-tools
|
|
|
|
|
2020-03-13 09:45:50 +00:00
|
|
|
- name: Install Rust toolchain (${{ matrix.rust }})
|
2020-03-05 11:16:51 +00:00
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-08-11 11:31:57 +00:00
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
override: true
|
2020-08-13 11:00:48 +00:00
|
|
|
|
2022-03-28 10:19:09 +00:00
|
|
|
- name: Build (default features)
|
2022-11-16 23:26:34 +00:00
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor -- -D warnings -D clippy::undocumented_unsafe_blocks
|
2021-09-07 14:28:58 +00:00
|
|
|
|
2022-09-26 16:02:18 +00:00
|
|
|
- name: Build (kvm)
|
2022-11-16 23:26:34 +00:00
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor --no-default-features --features "kvm" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
2021-09-07 14:28:58 +00:00
|
|
|
|
2022-03-28 10:19:09 +00:00
|
|
|
- name: Build (default features + tdx)
|
2022-11-16 23:26:34 +00:00
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor --features "tdx" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
2022-03-25 18:53:21 +00:00
|
|
|
|
2023-03-22 21:03:02 +00:00
|
|
|
- name: Build (default features + dbus_api)
|
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor --features "dbus_api" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
|
|
|
|
2022-05-24 02:46:27 +00:00
|
|
|
- name: Build (default features + guest_debug)
|
2022-11-16 23:26:34 +00:00
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor --features "guest_debug" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
2022-05-24 02:46:27 +00:00
|
|
|
|
2022-09-26 16:02:18 +00:00
|
|
|
- name: Build (mshv)
|
2022-11-16 23:26:34 +00:00
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor --no-default-features --features "mshv" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
2022-03-28 10:19:09 +00:00
|
|
|
|
2023-08-07 09:11:24 +00:00
|
|
|
- name: Build (sev_snp)
|
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor --no-default-features --features "sev_snp" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
|
|
|
|
2023-10-05 01:28:31 +00:00
|
|
|
- name: Build (igvm)
|
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor --no-default-features --features "igvm" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
|
|
|
|
2022-09-26 16:02:18 +00:00
|
|
|
- name: Build (mshv + kvm)
|
2022-11-16 23:26:34 +00:00
|
|
|
run: cargo rustc --locked --bin cloud-hypervisor --no-default-features --features "mshv,kvm" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
2022-07-20 23:59:24 +00:00
|
|
|
|
2020-08-13 11:00:48 +00: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 14:52:49 +00:00
|
|
|
|
|
|
|
- name: Check build did not modify any files
|
|
|
|
run: test -z "$(git status --porcelain)"
|