Commit Graph

116 Commits

Author SHA1 Message Date
Rob Bradford
84a6da5e93 build: Extend x86-64 GitHub action to AMD runner
Use the matrix to add a build runnind on the AMD variant of the garm
runner.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2024-02-22 13:07:32 +00:00
Rob Bradford
89f2a4882e build: Add GitHub action for ARM64 integration tests
Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2024-02-22 12:28:40 +00:00
Rob Bradford
307a0166c5 build: Add GitHub action for unit/integration testing
Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2024-02-22 12:23:44 +00:00
Ruslan Mstoi
af4a193b43 build: add shell script linter workflow
Implement workflow to to run static analysis and linting of all shell
scripts by using shfmt and shellcheck.

Fixes: #5396

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2024-02-13 10:20:18 +00:00
Rob Bradford
a511dd1b18 ci: Add cargo fuzz check to GitHub actions
See: #6085

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2024-01-08 17:39:05 +00:00
Jinank Jain
5d4fe8efb9 github: ci: Move to action/checkout v4
There is a mix of v2, v3 and v4 in the codebase. Let's move to v4
everywhere because v2 seems to be using a deprecated version of nodejs.
This is throwing warnings when the Github action CI is running.

Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
2023-12-11 13:29:11 +00:00
Muminul Islam
b9117c9c50 github: workflow: Build/quality test for igvm
Extend the current github actions to build and
test clippy for igvm feature.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2023-12-08 09:22:42 -08:00
Michael Zhao
70380d289f ci: Enable OpenAPI validate action
Pull the container `openapitools/openapi-generator-cli` and run the
validation.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
2023-11-20 07:45:55 +00:00
Ruslan Mstoi
ea7999e064 build: add gitlint commit message linter
Implement commit message check workflow using gitlint

Fixes: #5840

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2023-11-16 16:09:17 +00:00
Rob Bradford
13fae28635 build: Bump MSRV to 1.70 for clap crate
See: #5925

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-11-08 08:13:45 -08:00
Bo Chen
b312293604 build: Bump MSRV to 1.66
This is required for the following dependency:

toml_edit v0.19.15
└── proc-macro-crate v1.3.1
    ├── zbus_macros v3.14.1 (proc-macro)
        └── zbus v3.14.1
            ├── cloud-hypervisor v35.0.0 (/home/chenb/project/cloud-hypervisor/cloud-hypervisor)
            └── vmm v0.1.0 (/home/chenb/project/cloud-hypervisor/cloud-hypervisor/vmm)
                └── cloud-hypervisor v35.0.0 (/home/chenb/project/cloud-hypervisor/cloud-hypervisor)

Signed-off-by: Bo Chen <chen.bo@intel.com>
2023-11-01 13:05:30 +00:00
Muminul Islam
a1ce37c2af build: Bump MSRV to 1.65
Sev-Snp on MSHV uses igvm crate to parse the igvm file.
igvm crate needs minimum rust version 1.65 to build.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2023-10-19 08:42:17 +01:00
Philipp Schuster
83f3b34405 ci: Run typos
This adds the typos utility as dedicated CI step.

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
2023-09-09 10:46:21 +01:00
Jinank Jain
51548471fd github: worflow: Add build and clippy test for snp
Extend the current github actions to add support for snp feature flag.

Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
2023-09-07 12:52:27 +01:00
Bo Chen
3bb26093eb build: Enable default features for release workflow
In this way, we are releasing binaries with all default features plus
feature "mshv".

Signed-off-by: Bo Chen <chen.bo@intel.com>
2023-08-04 07:33:30 +01:00
Ruslan Mstoi
a0190b16aa Add Hadolint Dockerfile Linter to CI
Fixes #5332

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2023-06-20 12:39:18 -07:00
Omer Faruk Bayram
c016a0d4d3 vmm: dbus: implement the D-Bus API
This commit introduces three new dependencies: `zbus`, `futures`
and `blocking`. `blocking` is used to call the Internal API in zbus'
async context which is driven by `futures::executor`. They are all
behind the `dbus_api` feature flag.

The D-Bus API implementation is behind the same `dbus_api` feature
flag as well.

Signed-off-by: Omer Faruk Bayram <omer.faruk@sartura.hr>
2023-06-06 10:18:26 -07:00
Rob Bradford
b955f09b80 build: Bump MSRV to 1.64
This is required for openssl-src crate as it now uses functionality
first released in this version.

See: https://github.com/alexcrichton/openssl-src-rs/pull/184

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-06-06 17:34:22 +01:00
Rob Bradford
ca96ff601b build: Migrate from DockerHub to ghcr
It is necessary to transition away from DockerHub as the small
organisation plan in being EOLed.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2023-03-15 22:41:23 +00:00
Bo Chen
85962099c7 build: Update development container and release action to Rust 1.67
This latest stable Rust toolchain can help reduce the final binary size
around ~300k when comparing with building with Rust 1.62. Specifically,
the binary size now is 3.3M (previously 3.6M) with default feature, and
4.0M (previously 4.2M) with "kvm+mshv" feature (e.g. our release action
build) .

Signed-off-by: Bo Chen <chen.bo@intel.com>
2023-03-01 15:16:23 +00:00
Rob Bradford
7ceb126184 github: Build examples as well as tests in quality workflow
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2023-02-16 09:59:14 -08:00
Rob Bradford
8b9da4e286 build: Bump MSRV to 1.62
Needed for #[derive(Default)] on enums which is now clippy checked in
1.68.

Fixes: #5140

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2023-01-26 13:05:23 +00:00
Rob Bradford
f6c058da56 .github: Don't try and create releases for created branches
Dependabot will create a branch on the repo for it's updates this
triggers the release action (because it's the same event as a tag) which
will then fail leading to dependabot PRs not being automerged. Instead
only run the release check test on PRs or tag creation.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2023-01-20 09:58:53 +00:00
Rob Bradford
6e9172bf6f .github: Re-order release steps to ensure binaries are available
Since we run "cargo clean" before running the aarch64 build we need to
create the release and upload the x86-64 assets before the clean.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2023-01-14 12:12:11 +00:00
Rob Bradford
547230bb77 .github: Clean source tree before cross building release assets
This address issues with leaking symbols into the cross build.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2023-01-13 16:44:59 +00:00
Rob Bradford
ef7e177df2 .github: Run release style builds on all PRs
Adjust the release workflow to move the conditional check on the tag
creation into the steps that create the release/upload the assets.

This allows us to ensure we're always in a releaseable state.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2023-01-13 14:38:15 +00:00
Rob Bradford
a1c6ef8385 .github: Add musl variants to quality (clippy) checks
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-12-07 17:50:48 +00:00
Rob Bradford
c37dadcc9a .github: Enable "guest_debug" clippy on aarch64
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-12-05 17:23:52 +00:00
Rob Bradford
7fd2022e8e .github: Ensure target used for clippy tests
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-12-01 17:02:30 +00:00
Rob Bradford
1b6dd597b2 .github: Remove build testing for aarch64 with guest_debug feature
See: #4964

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-12-01 17:02:30 +00:00
Henry Wang
1ff0191b30 github,Cargo.toml: Strip release binaries using toolchain
From Rust 1.59, the cargo command is now able to strip a binary [1].
This can be enabled in Cargo.toml by adding a `strip = "true"` to
the `[profile.release]` section.

Adding such binary stripping support in Cargo.toml of the project,
also change the stripping process in the release workflow to the one
using toolchain, so that the AArch64 release binaries can also
be stripped.

Fixes: https://github.com/cloud-hypervisor/cloud-hypervisor/issues/4916

[1] https://doc.rust-lang.org/beta/cargo/reference/profiles.html#strip

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2022-11-21 13:39:29 +00:00
Muminul Islam
bfeab9f69f .github: do release build with both KVM and MSHV enabled
Fixes: #4678

Currently release build is done on kvm feature only,
that makes live upgrade test on MSHV failing since
it does not find /dev/kvm. As Cloud-Hypervisor
supports both kvm and mshv in a single binary we should
make the release build with both KVM/MSHV feature enabled.
That way live upgrade test does not fail on MSHV.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2022-11-18 19:15:25 +00:00
Wei Liu
3ca6c29e28 github: do not allow undocumented unsafe blocks
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2022-11-18 12:50:01 +00:00
Rob Bradford
06eb82d239 build: Consolidate "gdb" build feature into "guest_debug"
This simplifies the CI process but also logical with the existing
functionality under "guest_debug" (dumping guest memory).

Fixes: #4679

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-09-27 14:30:57 +01:00
Rob Bradford
b2d1dd65f3 build: Remove "fwdebug" and "common" feature flags
This simplifes the buld and checks with very little overhead and the
fwdebug device is I/O port device on 0x402 that can be used by edk2 as a
very simple character device.

See: #4679

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-09-26 10:16:33 -07:00
Rob Bradford
36e26f004c .github: Consolidate quality checks into single worklow
Combine aarch64 and x86-64 checks into one workflow

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-09-26 16:52:42 +01:00
Rob Bradford
c98bd2fd4a .github: Add clippy check of tracing feature
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-09-22 18:09:31 +01:00
Sebastien Boeuf
1849ffff31 vmm: Remove "amx" feature gate
Given the AMX x86 feature has been made available since kernel v5.17,
and given we don't have any test validating this feature, there's no
need to keep it behing a Rust feature gate.

Fixes #3996

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2022-09-16 15:03:31 +01:00
Rob Bradford
616ec530a8 .github: workflows: Fail on intermediate steps for commit checks
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-08-30 21:40:31 +01:00
Rob Bradford
850c0c8319 .github: workflows: Fix per commit buildability check
Fetch the whole git repository (not just the specific commit) and use
the github context instead of hardcoded branch.

Unfortunately now that we process the list of revisions correctly it
shows that the checks don't work on aarch64 due to cross limitations so
this has been removed.

Fixes: #4523

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-08-30 21:40:31 +01:00
Rob Bradford
c59b5e18a8 .github: Move per-commit check (using --tests) to quality checks
This removes the requirement for the tests (dev-dependencies) to build
with all supported toolchains including the MSRV.

See: #4318

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-08-11 13:18:33 +01:00
Wei Liu
5aaa647639 .github: build MSHV and KVM at the same time
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2022-07-22 12:50:12 +01:00
Rob Bradford
5dfc49c9fa build: Update development container to Rust 1.62
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-07-05 11:50:46 +01:00
Rob Bradford
4ddc6ffd73 .github: Add missing clippy check with "guest_debug" feature
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-06-08 11:40:56 +01:00
Yi Wang
6ab93a08ec build: Add GitHub action to build test guest_debug feature
Add guest_debug feature test for github workflows.

Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
2022-05-30 13:41:40 +02:00
Rob Bradford
ebaea6fe0f .github: Use 1.60 toolchain consistently in release process
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-05-25 23:56:51 +02:00
Rob Bradford
ffd1411e7c build: Bump minimum Rust version to 1.60
Some dependencies (e.g. pnet 0.30.0) require it.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-05-24 16:02:08 +01:00
Rob Bradford
02358d3091 Revert ".github: Fix Rust version for release to 1.58"
This reverts commit 6a099257e8.

It is now clear that pinning the toolchain for cross compilation is not
necessary since we only use it for building to aarch64:

https://github.com/rust-lang/rust/issues/95926#issue-1199547707

"This problem doesn't currently show up when cross-compiling from x86_64
to aarch64, since aarch64 doesn't use static-pie by default, but
enabling PIE with -C relocation-model=pie triggers the same bug and
makes the resulting binaries segfault."

Fixes: #3962

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-05-23 16:38:27 +01:00
Wei Liu
babece08c6 github: use --locked in cargo invocations
Cargo comes with a --locked option that makes sure Cargo.lock is not
changed.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
2022-04-19 13:44:24 +01:00
Rob Bradford
cd2b167b33 .github: Use correct toolchain version for release builds
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-04-13 10:21:05 -07:00