diff --git a/.github/workflows/clh_build.yaml b/.github/workflows/clh_build.yaml index 8579853..22b12fd 100644 --- a/.github/workflows/clh_build.yaml +++ b/.github/workflows/clh_build.yaml @@ -4,7 +4,7 @@ on: [pull_request, create] jobs: build: if: github.event_name == 'pull_request' - name: Cloud Hypervisor Build using MSHV chnages + name: Cloud Hypervisor Build using MSHV changes runs-on: ubuntu-latest strategy: matrix: @@ -28,18 +28,16 @@ jobs: - name: Cloning Cloud Hypervisor Repo uses: actions/checkout@v4 with: - depth: 1 - branch: 'main' repository: cloud-hypervisor/cloud-hypervisor path: cloud-hypervisor - name: Copying script to CLH directory working-directory: ./mshv - run: cp scripts/use-local-mshv.sh ../cloud-hypervisor/ + run: cp scripts/use-local-mshv-for-clh-build.sh ../cloud-hypervisor/ - name: Applying patch(to use local mshv crates) with script working-directory: ./cloud-hypervisor - run: ./use-local-mshv.sh + run: ./use-local-mshv-for-clh-build.sh - name: Build Cloud-Hypervisor(mshv,kvm) working-directory: ./cloud-hypervisor diff --git a/.github/workflows/vfio_build.yaml b/.github/workflows/vfio_build.yaml new file mode 100644 index 0000000..b593160 --- /dev/null +++ b/.github/workflows/vfio_build.yaml @@ -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 + diff --git a/scripts/use-local-mshv.sh b/scripts/use-local-mshv-for-clh-build.sh similarity index 100% rename from scripts/use-local-mshv.sh rename to scripts/use-local-mshv-for-clh-build.sh diff --git a/scripts/use-local-mshv-for-vfio-build.sh b/scripts/use-local-mshv-for-vfio-build.sh new file mode 100755 index 0000000..ebb5f45 --- /dev/null +++ b/scripts/use-local-mshv-for-vfio-build.sh @@ -0,0 +1,6 @@ +#! /bin/sh + +sed -i 's/mshv-ioctls = { git = "https:\/\/github.com\/rust-vmm\/mshv", branch = "main", optional = true }*/mshv-ioctls = { path = \"..\/..\/..\/mshv\/mshv-ioctls\", optional = true }/g' ./crates/vfio-ioctls/Cargo.toml +sed -i 's/mshv-bindings = { git = "https:\/\/github.com\/rust-vmm\/mshv", branch = "main", features = \["with-serde", "fam-wrappers"\], optional = true }*/mshv-bindings = { path = "..\/..\/..\/mshv\/mshv-bindings", features = ["with-serde", "fam-wrappers"], optional = true }/g' ./crates/vfio-ioctls/Cargo.toml + +