Commit Graph

30 Commits

Author SHA1 Message Date
Rob Bradford
d485896edd build: Bump Rust version from 1.74.0 to 1.74.1
Fixes: #6368

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2024-04-08 21:11:57 +00:00
Rob Bradford
6f49d7f192 build: Avoid cancellation of release build workflow on MQ
When running on the merge group this workflow is run twice - once for
the create event (merge queue creates a new branch) and once for the
merge_group event. Unfortunately the second event would cause the first
to be cancelled - unfortunately sometimes that second event is the
create event where the job in the workflow only runs if it is also a
tag.

By creating distinct concurrency groups for each event type then the
cross cancellation can be avoided.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2024-03-02 12:41:21 +00:00
Rob Bradford
084eb0792d build: Bump MSRV to 1.74
This is required for the updated clap crate (see #6237)

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2024-02-29 19:42:16 +00:00
Rob Bradford
1db30405e1 build: Cancel in progress actions on update
If the PR updated cancel outstanding jobs to conserve resources.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2024-02-28 20:11:20 +00:00
Rob Bradford
022f375ef8 build: Skip release check on pull requests
This takes a long time and duplicates existing checks on the pull
requests.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2024-02-28 20:11:20 +00:00
Rob Bradford
d9f48505fe build: Ensure all required checks run on merge_group
And clean up some of the whitespace formatting so that the "name" and
"on" are grouped away from the "jobs".

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
2024-02-28 20:11:20 +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
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
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
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
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
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
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
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
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
Rob Bradford
6a099257e8 .github: Fix Rust version for release to 1.58
Unfortunately Rust 1.59 produces binaries that segfault when compiled
with musl-gcc wrappers. Which is exactly how we produce out aarch64 and
musl binaries for the release.

See: https://github.com/rust-lang/rust/issues/95926

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-04-11 22:53:34 +01:00
Rob Bradford
e2e070ad8a github: Install missing musl tools
Needed since:

commit 0ab4097606
Author: Bo Chen <chen.bo@intel.com>
Date:   Thu Feb 10 18:29:53 2022 -0800

    test_infra: Enable cross-build for "musl" and "aarch64" targets

    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>

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2022-03-03 15:38:36 +00:00
Rob Bradford
58d3d4c34e build: Include static ch-remote binary in release
Fixes: #3425

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-12-07 11:17:29 +01:00
William Douglas
1c2ab3e771 workflow: Add vendored source release content
Create a source archive with vendored sources as part of the release
workflow. This is to enable building the release offline for distros.

Note: The use of realpath and CARGO_HOME are to work around a cargo
vendor bug: https://github.com/rust-lang/cargo/issues/8443.

Signed-off-by: William Douglas <william.douglas@intel.com>
2021-10-26 16:17:38 +01:00
Rob Bradford
977a893d86 .github: Add aarch64 cross build to release
Fixes: #3099

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2021-09-09 15:10:10 +01:00
Rob Bradford
1e9956c8cb build: github: Prepare for splitting binaries by building all binaries
In preparation for splitting the binaries into their own crates start
building all the binaries in the workspace when doing a build as part of
the GitHub actions.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2020-07-06 10:56:10 +02:00
Rob Bradford
6fde2d18a6 build: Strip the binaries before using/releasing them
Stripping the release build for glibc shrinks the size considerably:

$ du -h target/release/cloud-hypervisor
8.5M    target/release/cloud-hypervisor
$ strip target/release/cloud-hypervisor
$ du -h target/release/cloud-hypervisor
5.2M    target/release/cloud-hypervisor

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2020-05-07 12:31:01 +01:00
Samuel Ortiz
86fcd19b8a build: Initial musl support
Fix all build failures and add musl to the gihub workflows.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2020-04-29 17:57:01 +01:00
Samuel Ortiz
e685854f16 gh: Separate the build and release jobs
The release one is always skipped for PRs which can be confusing for
e.g. dependabot.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2020-04-23 13:45:12 +02:00