Skip to content

Commit

Permalink
.github: Add a new workflow to compile vfio crates
Browse files Browse the repository at this point in the history
Signed-off-by: Muminul Islam <muislam@microsoft.com>
  • Loading branch information
russell-islam committed May 1, 2024
1 parent f739486 commit 76bbc50
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/vfio_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: VFIO Build
on: [pull_request, create]

jobs:
build:
if: github.event_name == 'pull_request'
name: VFIO Build using MSHV changes
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
target:
- x86_64-unknown-linux-gnu
steps:
- name: Code checkout
uses: actions/checkout@v4
with:
path: mshv

- name: Install Rust toolchain (${{ matrix.rust }})
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
components: rustfmt, clippy

- name: Cloning vfio Repo
uses: actions/checkout@v4
with:
repository: rust-vmm/vfio
path: vfio
- name: Copying script to vfio directory
working-directory: ./mshv
run: cp scripts/use-local-mshv-for-vfio-build.sh ../vfio/

- name: Applying patch(to use local mshv crates) with script
working-directory: ./vfio
run: ./use-local-mshv-for-vfio-build.sh

- name: Build vfio(mshv)
working-directory: ./vfio
run: cargo build --release --all --no-default-features --features mshv

- name: Build vfio(nohv)
working-directory: ./vfio
run: cargo build --release --no-default-features

- name: Clippy(mshv)
working-directory: ./vfio
run: cargo clippy --workspace --bins --examples --benches --no-default-features --features mshv --all-targets -- -D warnings

- name: Clippy(nohv)
working-directory: ./vfio
run: cargo clippy --workspace --bins --examples --benches --no-default-features --all-targets -- -D warnings

0 comments on commit 76bbc50

Please sign in to comment.