mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-05 11:31:14 +00:00
0ab4097606
With enabling the `vendered-openssl` feature, we can now cross-build the `test_infra` crate for "musl" and "aarch64" targets. In this way, we can remove the `test_infra` crate from the "exclude" list, so that this crate can be checked and processed by "cargo clippy" and "cargo fmt". More details can be found: https://docs.rs/openssl/latest/openssl/#vendored As 'musl-gcc' is required, this commit also installs the `musl-tools` package for our "build" github action on the musl target [1]. [1] https://github.com/actions-rs/toolchain/issues/102 Signed-off-by: Bo Chen <chen.bo@intel.com>
60 lines
1.9 KiB
YAML
60 lines
1.9 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:
|
|
fail-fast: false
|
|
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 musl-gcc
|
|
run: sudo apt install -y musl-tools
|
|
|
|
- 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/main..$GITHUB_SHA | xargs -t -I % sh -c 'git checkout %; cargo check --all --target=${{ matrix.target }}'
|
|
git checkout $GITHUB_SHA
|
|
|
|
- name: Build (default + tdx)
|
|
run: cargo rustc --bin cloud-hypervisor --features "tdx" -- -D warnings
|
|
|
|
- name: Build (acpi,kvm)
|
|
run: cargo rustc --bin cloud-hypervisor --no-default-features --features "acpi,kvm" -- -D warnings
|
|
|
|
- name: Build (kvm)
|
|
run: cargo rustc --bin cloud-hypervisor --no-default-features --features "kvm" -- -D warnings
|
|
|
|
- name: Build (acpi,mshv)
|
|
run: cargo rustc --bin cloud-hypervisor --no-default-features --features "acpi,mshv" -- -D warnings
|
|
|
|
- name: Build (mshv)
|
|
run: cargo rustc --bin cloud-hypervisor --no-default-features --features "mshv" -- -D warnings
|
|
|
|
- name: Release Build (default features)
|
|
run: cargo build --all --release --target=${{ matrix.target }}
|
|
|
|
- name: Check build did not modify any files
|
|
run: test -z "$(git status --porcelain)"
|