Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ rustflags = ["-C", "target-feature=+crt-static", "-C", "link-arg=-Wl,-z,stack-si

[target.x86_64-unknown-linux-musl]
rustflags = ["-C", "target-feature=+crt-static", "-C", "link-arg=-Wl,-z,stack-size=2097152"]

# Windows MSVC: allow duplicate symbols when linking libkrun staticlib into Rust binaries.
# libkrun is built as a staticlib (bundles Rust stdlib) for C consumers, but when linked
# into a Rust binary the stdlib symbols collide. /FORCE:MULTIPLE resolves this safely
# since both copies are identical.
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "link-arg=/FORCE:MULTIPLE"]
93 changes: 93 additions & 0 deletions .github/workflows/test-windows-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Windows E2E integration tests on self-hosted WHPX runners.
#
# GitHub-hosted runners lack Hyper-V/WHPX, so real VM tests require
# self-hosted machines with hardware virtualization enabled.
#
# Triggered manually via workflow_dispatch. Intended for pre-release
# validation and reliability regression testing.
name: Windows E2E (Manual)

on:
workflow_dispatch:
inputs:
rounds:
description: 'Number of stability test rounds'
default: '5'
type: string
suite:
description: 'Test suite to run'
default: 'all'
type: choice
options:
- all
- stability
- functional
- performance
skip_perf:
description: 'Skip performance suite (faster)'
type: boolean
default: false

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: '0'

jobs:
windows-e2e:
name: WHPX E2E (${{ matrix.machine }})
runs-on: [self-hosted, windows, whpx, '${{ matrix.machine }}']
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
machine: [win10, win11]

steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: recursive

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable

- name: Install protobuf
run: choco install protoc -y

- name: Kill stale shim processes
run: |
taskkill /F /IM boxlite-shim.exe 2>$null
exit 0
shell: pwsh

- name: Build shim
run: cargo build -p boxlite --bin boxlite-shim --features krun,gvproxy

- name: Install Python SDK
run: pip install -e sdks/python/

- name: Run E2E tests
run: |
$suite = "${{ inputs.suite }}"
$rounds = "${{ inputs.rounds }}"
$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
$outfile = "e2e-results-${{ matrix.machine }}-${timestamp}.json"

$args = @("scripts/test/cross_platform_e2e.py", "--rounds", $rounds, "--json", $outfile)
if ($suite -ne "all") {
$args += @("--suite", $suite)
}
python @args

Write-Host "Results saved to $outfile"
shell: pwsh

- name: Upload results
if: always()
uses: actions/upload-artifact@v4
with:
name: whpx-e2e-${{ matrix.machine }}
path: e2e-results-*.json
retention-days: 14
59 changes: 59 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Windows compile, lint, and unit test checks.
#
# GitHub runners do not have WHPX/Hyper-V, so we use BOXLITE_DEPS_STUB=1
# to stub out native dependencies (libkrun, libgvproxy) and verify:
# - All cfg(windows) code compiles
# - Clippy passes on Windows target
# - Unit tests pass (633 tests, all platform-independent)
name: Windows

on:
push:
branches: [main]
paths:
- 'src/**/*.rs'
- '**/Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/test-windows.yml'
pull_request:
branches: [main]
paths:
- 'src/**/*.rs'
- '**/Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/test-windows.yml'

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: '0'
BOXLITE_DEPS_STUB: '1'

jobs:
windows-check:
name: Windows compile + clippy + tests
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: clippy

- name: Install protobuf
run: choco install protoc -y

- name: Cargo check (all crates)
# Exclude boxlite-guest (Linux-only, has compile_error! on non-Linux)
run: cargo check --workspace --all-targets --exclude boxlite-guest

- name: Clippy
run: cargo clippy --workspace --all-targets --exclude boxlite-guest -- -D warnings

- name: Unit tests (boxlite)
run: cargo test -p boxlite --no-default-features --lib

- name: Unit tests (boxlite-shared)
run: cargo test -p boxlite-shared --lib
14 changes: 14 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading