Skip to content

Commit b6c4bc1

Browse files
committed
ci: build cloud-hypervisor from latest upstream release
Ubuntu does not package Cloud Hypervisor, so the integration test cannot rely on apt for that binary. Resolve the latest upstream release tag, check out that source, install the needed dev packages, build with cargo --release, and reuse the existing rust-cache target-dir caching for later runs.
1 parent 9ad924d commit b6c4bc1

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

.github/workflows/rust.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,44 @@ jobs:
5858
with:
5959
key: "integration-test"
6060
cache-directories:
61+
./.ci/cloud-hypervisor-target
6162
./integration-test/x86/target
6263
./integration-test/riscv/target
63-
- name: Install QEMU
64+
- name: Resolve latest Cloud Hypervisor release
65+
id: chv_release
66+
run: |
67+
tag=$(
68+
curl -fsSL \
69+
https://api.github.com/repos/cloud-hypervisor/cloud-hypervisor/releases/latest \
70+
| python3 -c 'import json,sys; print(json.load(sys.stdin)["tag_name"])'
71+
)
72+
echo "tag=$tag" >> "$GITHUB_OUTPUT"
73+
- name: Install integration-test dependencies
6474
run: |
6575
sudo apt-get update
66-
sudo apt-get install -y qemu-system-x86 qemu-system-misc
67-
76+
# QEMU
77+
sudo apt-get install -y
78+
qemu-system-misc \
79+
qemu-system-x86
80+
# Building cloud Hypervisor
81+
sudo apt-get install -y \
82+
libssl-dev \
83+
pkg-config
84+
- name: Check out latest Cloud Hypervisor release source
85+
env:
86+
CHV_TAG: ${{ steps.chv_release.outputs.tag }}
87+
run: |
88+
rm -rf ./.ci/cloud-hypervisor-src
89+
git clone --depth 1 --branch "$CHV_TAG" \
90+
https://github.com/cloud-hypervisor/cloud-hypervisor.git \
91+
./.ci/cloud-hypervisor-src
92+
- name: Build Cloud Hypervisor from latest upstream release
93+
env:
94+
CARGO_TARGET_DIR: ${{ github.workspace }}/.ci/cloud-hypervisor-target
95+
working-directory: ./.ci/cloud-hypervisor-src
96+
run: cargo build --release
97+
- name: Verify Cloud Hypervisor installation
98+
run: ./.ci/cloud-hypervisor-target/release/cloud-hypervisor --version
6899
- name: Verify QEMU installation
69100
run: |
70101
qemu-system-i386 --version
@@ -73,6 +104,8 @@ jobs:
73104
working-directory: integration-test
74105
run: make
75106
- name: Run
107+
env:
108+
PATH: ${{ github.workspace }}/.ci/cloud-hypervisor-target/release:${PATH}
76109
working-directory: integration-test
77110
run: make run
78111

0 commit comments

Comments
 (0)