2020-08-13 11:00:48 +00:00
|
|
|
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
|
2021-03-26 13:55:48 +00:00
|
|
|
continue-on-error: ${{ matrix.experimental }}
|
2020-08-13 11:00:48 +00:00
|
|
|
strategy:
|
2021-03-26 13:55:48 +00:00
|
|
|
fail-fast: false
|
2020-08-13 11:00:48 +00:00
|
|
|
matrix:
|
|
|
|
rust:
|
|
|
|
- stable
|
|
|
|
target:
|
2022-09-22 09:56:49 +00:00
|
|
|
- aarch64-unknown-linux-gnu
|
2022-12-07 15:51:46 +00:00
|
|
|
- aarch64-unknown-linux-musl
|
|
|
|
- x86_64-unknown-linux-gnu
|
|
|
|
- x86_64-unknown-linux-musl
|
|
|
|
|
2021-03-26 13:55:48 +00:00
|
|
|
experimental: [false]
|
|
|
|
include:
|
2022-12-07 15:51:46 +00:00
|
|
|
- rust: beta
|
|
|
|
target: aarch64-unknown-linux-gnu
|
|
|
|
experimental: true
|
|
|
|
- rust: beta
|
|
|
|
target: aarch64-unknown-linux-musl
|
|
|
|
experimental: true
|
2021-03-26 13:55:48 +00:00
|
|
|
- rust: beta
|
|
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
experimental: true
|
2022-09-22 09:56:49 +00:00
|
|
|
- rust: beta
|
2022-12-07 15:51:46 +00:00
|
|
|
target: x86_64-unknown-linux-musl
|
2022-09-22 09:56:49 +00:00
|
|
|
experimental: true
|
2020-08-13 11:00:48 +00:00
|
|
|
steps:
|
|
|
|
- name: Code checkout
|
2022-08-19 16:26:14 +00:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
2020-08-13 11:00:48 +00:00
|
|
|
- name: Install Rust toolchain (${{ matrix.rust }})
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2020-12-08 17:39:06 +00:00
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
|
2022-08-11 11:31:57 +00:00
|
|
|
- name: Debug Check (default features)
|
2022-09-22 09:56:49 +00:00
|
|
|
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
|
2022-08-11 11:31:57 +00:00
|
|
|
run: |
|
2022-08-30 17:15:54 +00:00
|
|
|
set -e
|
|
|
|
commits=$(git rev-list origin/${{ github.base_ref }}..${{ github.sha }})
|
2023-02-16 08:02:03 +00:00
|
|
|
for commit in $commits; do git checkout $commit; cargo check --tests --examples --all --target=${{ matrix.target }}; done
|
2022-08-19 16:26:14 +00:00
|
|
|
git checkout ${{ github.sha }}
|
2022-08-11 11:31:57 +00:00
|
|
|
|
2020-08-13 11:00:48 +00:00
|
|
|
- name: Formatting (rustfmt)
|
|
|
|
run: cargo fmt -- --check
|
|
|
|
|
2022-09-26 16:02:18 +00:00
|
|
|
- name: Clippy (kvm)
|
2022-09-22 09:56:49 +00:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
|
|
|
|
command: clippy
|
2023-02-16 08:02:03 +00:00
|
|
|
args: --target=${{ matrix.target }} --locked --all --all-targets --no-default-features --tests --examples --features "kvm" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
2020-12-08 17:39:06 +00:00
|
|
|
|
2022-03-28 10:19:09 +00:00
|
|
|
- name: Clippy (default features)
|
2022-09-22 09:56:49 +00:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
|
|
|
|
command: clippy
|
2023-02-16 08:02:03 +00:00
|
|
|
args: --target=${{ matrix.target }} --locked --all --all-targets --tests --examples -- -D warnings -D clippy::undocumented_unsafe_blocks
|
2021-01-25 11:14:26 +00:00
|
|
|
|
2022-06-08 09:49:43 +00:00
|
|
|
- name: Clippy (default features + guest_debug)
|
2022-09-22 09:56:49 +00:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
|
|
|
|
command: clippy
|
2023-02-16 08:02:03 +00:00
|
|
|
args: --target=${{ matrix.target }} --locked --all --all-targets --tests --examples --features "guest_debug" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
2022-06-08 09:49:43 +00:00
|
|
|
|
2022-09-21 15:11:15 +00:00
|
|
|
- name: Clippy (default features + tracing)
|
2022-09-22 09:56:49 +00:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
|
|
|
|
command: clippy
|
2023-02-16 08:02:03 +00:00
|
|
|
args: --target=${{ matrix.target }} --locked --all --all-targets --tests --examples --features "tracing" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
2022-09-21 15:11:15 +00:00
|
|
|
|
2022-09-26 16:02:18 +00:00
|
|
|
- name: Clippy (mshv)
|
2022-09-22 09:56:49 +00:00
|
|
|
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
|
|
|
|
command: clippy
|
2023-02-16 08:02:03 +00:00
|
|
|
args: --target=${{ matrix.target }} --locked --all --all-targets --no-default-features --tests --examples --features "mshv" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
2021-06-18 14:52:49 +00:00
|
|
|
|
2022-09-26 16:02:18 +00:00
|
|
|
- name: Clippy (mshv + kvm)
|
2022-09-22 09:56:49 +00:00
|
|
|
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
|
|
|
|
command: clippy
|
2023-02-16 08:02:03 +00:00
|
|
|
args: --target=${{ matrix.target }} --locked --all --all-targets --no-default-features --tests --examples --features "mshv,kvm" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
2022-09-22 09:56:49 +00:00
|
|
|
|
2023-08-07 09:11:24 +00:00
|
|
|
- name: Clippy (sev_snp)
|
|
|
|
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
|
|
|
|
command: clippy
|
|
|
|
args: --target=${{ matrix.target }} --locked --all --all-targets --no-default-features --tests --examples --features "sev_snp" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
|
|
|
|
2022-09-26 16:02:18 +00:00
|
|
|
- name: Clippy (kvm + tdx)
|
2022-09-22 09:56:49 +00:00
|
|
|
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
use-cross: ${{ matrix.target != 'x86_64-unknown-linux-gnu' }}
|
|
|
|
command: clippy
|
2023-02-16 08:02:03 +00:00
|
|
|
args: --target=${{ matrix.target }} --locked --all --all-targets --no-default-features --tests --examples --features "tdx,kvm" -- -D warnings -D clippy::undocumented_unsafe_blocks
|
2022-07-20 23:59:24 +00:00
|
|
|
|
2021-06-18 14:52:49 +00:00
|
|
|
- name: Check build did not modify any files
|
|
|
|
run: test -z "$(git status --porcelain)"
|