Skip to content

Bump the gh-actions-dependencies group with 2 updates #249

Bump the gh-actions-dependencies group with 2 updates

Bump the gh-actions-dependencies group with 2 updates #249

name: Run integration tests
on:
pull_request:
types: [labeled, synchronize, reopened]
paths-ignore:
- 'docs/**'
env:
CH_REPO: cloud-hypervisor/cloud-hypervisor
CH_REF: 71cd7989efc0f168fa9ed0d35094719760c56b44
EDK2_FW_REPO: ironcore-dev/cloud-hypervisor-provider
EDK2_FW_TAG: ch-fw-edk2-stable202508
permissions:
contents: read
jobs:
# NOTE: this job only runs on x86_64 (ubuntu-24.04). cloud-hypervisor is built
# natively for amd64; ARM is NOT exercised here, which is why the arm-acpi fork
# used by .github/workflows/cloud-hypervisor.yml is not needed for this job.
integration-tests:
runs-on: ubuntu-24.04
if: contains(github.event.pull_request.labels.*.name, 'integration-tests')
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup go
uses: actions/setup-go@v7
with:
go-version-file: 'go.mod'
- name: Checkout cloud-hypervisor (upstream)
uses: actions/checkout@v7
with:
repository: ${{ env.CH_REPO }}
ref: ${{ env.CH_REF }}
path: cloud-hypervisor-src
persist-credentials: false
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cloud-hypervisor build
uses: Swatinem/rust-cache@v2
with:
workspaces: cloud-hypervisor-src
key: ${{ env.CH_REF }}
- name: Build cloud-hypervisor (--features fw_cfg)
working-directory: cloud-hypervisor-src
run: |
set -x
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends build-essential pkg-config
# cloud-hypervisor's default features (io_uring, kvm) plus fw_cfg.
cargo build --release --bin cloud-hypervisor --features fw_cfg
sudo cp target/release/cloud-hypervisor /usr/local/bin/cloud-hypervisor
sudo chmod a+x /usr/local/bin/cloud-hypervisor
/usr/local/bin/cloud-hypervisor --version
# cloud-hypervisor built with --features fw_cfg exposes --fw-cfg-config.
/usr/local/bin/cloud-hypervisor --help | grep -q fw-cfg-config
- name: Install dependencies
run: |
set -x
if [ ! -e /dev/kvm ]; then
echo "KVM not available"
exit 1
fi
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
ca-certificates libc-bin gcc cpu-checker
sudo update-ca-certificates
sudo rm -rf /var/lib/apt/lists
sudo curl -fL "https://github.com/${EDK2_FW_REPO}/releases/download/${EDK2_FW_TAG}/CLOUDHV.fd" \
-o /usr/local/bin/CLOUDHV.fd
sudo chmod 0644 /usr/local/bin/CLOUDHV.fd
echo "CH_FIRMWARE_PATH=/usr/local/bin/CLOUDHV.fd" >> $GITHUB_ENV
# The provider spins up cloud-hypervisor on demand (one process per
# machine, under a per-test temp dir) rather than adopting pre-launched
# instances. The test process does the spawning, so it just needs KVM
# access; make /dev/kvm usable by the unprivileged runner user.
sudo chmod 0666 /dev/kvm
- name: Run integration tests
run: |
sudo kvm-ok
/usr/local/bin/cloud-hypervisor --version
make integration-tests