Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/Fuzzing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ jobs:
uses: actions/checkout@v5

- name: Notify Fuzzing Failure
run: ./dev/notify-fuzzing-failure.sh "fuzz_host_print,fuzz_guest_call,fuzz_host_call"
run: ./dev/notify-ci-failure.sh --labels="area/fuzzing,kind/bug,area/testing,lifecycle/needs-review"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/RustNightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Nightly

on:
workflow_dispatch:
schedule:
- cron: '0 0 */2 * *'

jobs:
musl:
strategy:
fail-fast: true
matrix:
hypervisor: [kvm, mshv3]
cpu: [amd, intel]
config: [debug, release]
uses: ./.github/workflows/dep_rust.yml
secrets: inherit
with:
hypervisor: ${{ matrix.hypervisor }}
cpu: ${{ matrix.cpu }}
config: ${{ matrix.config }}
target_triple: x86_64-unknown-linux-musl

notify-failure:
runs-on: ubuntu-latest
needs: musl
if: always() && needs.musl.result == 'failure'
permissions:
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Notify Nightly Failure
run: ./dev/notify-ci-failure.sh --title="Nightly musl Failure - ${{ github.run_number }}" --labels="area/ci-periodics,area/testing,kind/bug,lifecycle/needs-review"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/ValidatePullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,19 @@ jobs:
rust:
needs:
- docs-pr
strategy:
fail-fast: true
matrix:
hypervisor: [hyperv, 'hyperv-ws2025', mshv, mshv3, kvm]
cpu: [amd, intel]
config: [debug, release]
uses: ./.github/workflows/dep_rust.yml
secrets: inherit
with:
docs_only: ${{needs.docs-pr.outputs.docs-only}}
hypervisor: ${{ matrix.hypervisor }}
cpu: ${{ matrix.cpu }}
config: ${{ matrix.config }}

fuzzing:
needs:
Expand Down
105 changes: 62 additions & 43 deletions .github/workflows/dep_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ on:
required: false
type: string
default: "false"
target_triple:
description: Target triple for cross-compilation
required: false
type: string
default: ""
hypervisor:
description: Hypervisor for this run (passed from caller matrix)
required: false
type: string
default: "kvm"
config:
description: Build configuration for this run (passed from caller matrix)
required: false
type: string
default: "debug"
cpu:
description: CPU architecture for the build (passed from caller matrix)
required: false
type: string
default: "amd"

env:
CARGO_TERM_COLOR: always
Expand All @@ -32,17 +52,12 @@ defaults:

jobs:
code-checks:
if: ${{ inputs.docs_only == 'false' }}
if: ${{ inputs.docs_only == 'false' && (inputs.hypervisor == 'hyperv-ws2025' || inputs.hypervisor == 'kvm') }}
timeout-minutes: 60
strategy:
fail-fast: true
matrix:
hypervisor: ['hyperv-ws2025', kvm]
config: [debug, release]
runs-on: ${{ fromJson(
format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-amd"]',
(matrix.hypervisor == 'hyperv-ws2025') && 'Windows' || 'Linux',
matrix.hypervisor == 'hyperv-ws2025' && 'win2025' || 'kvm')) }}
(inputs.hypervisor == 'hyperv-ws2025') && 'Windows' || 'Linux',
inputs.hypervisor == 'hyperv-ws2025' && 'win2025' || 'kvm')) }}
steps:
- uses: actions/checkout@v5

Expand All @@ -63,32 +78,29 @@ jobs:
- name: clippy
if: ${{ (runner.os == 'Windows' )}}
run: |
just clippy ${{ matrix.config }}
just clippy-guests ${{ matrix.config }}
just clippy ${{ inputs.config }}
just clippy-guests ${{ inputs.config }}
env:
TARGET_TRIPLE: ${{ inputs.target_triple }}

- name: clippy exhaustive check
if: ${{ (runner.os == 'Linux' )}}
run: |
just clippy-exhaustive ${{ matrix.config }}
just clippy-exhaustive ${{ inputs.config }}
env:
TARGET_TRIPLE: ${{ inputs.target_triple }}

- name: Verify MSRV
run: ./dev/verify-msrv.sh hyperlight-host hyperlight-guest hyperlight-guest-bin hyperlight-common

build:
if: ${{ inputs.docs_only == 'false' }}
timeout-minutes: 60
strategy:
fail-fast: true
matrix:
hypervisor: [hyperv, 'hyperv-ws2025', mshv, mshv3, kvm] # hyperv is windows, mshv and kvm are linux
cpu: [amd, intel]
config: [debug, release]

runs-on: ${{ fromJson(
format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}"]',
(matrix.hypervisor == 'hyperv' || matrix.hypervisor == 'hyperv-ws2025') && 'Windows' || 'Linux',
matrix.hypervisor == 'hyperv' && 'win2022' || matrix.hypervisor == 'hyperv-ws2025' && 'win2025' || matrix.hypervisor == 'mshv3' && 'azlinux3-mshv' || matrix.hypervisor,
matrix.cpu)) }}
(inputs.hypervisor == 'hyperv' || inputs.hypervisor == 'hyperv-ws2025') && 'Windows' || 'Linux',
inputs.hypervisor == 'hyperv' && 'win2022' || inputs.hypervisor == 'hyperv-ws2025' && 'win2025' || inputs.hypervisor == 'mshv3' && 'azlinux3-mshv' || inputs.hypervisor,
inputs.cpu)) }}
steps:
- uses: actions/checkout@v5

Expand All @@ -112,79 +124,86 @@ jobs:
- name: Build and move Rust guests
run: |
# use these commands in favor of build-and-move-rust-guests to avoid building both configs
just build-rust-guests ${{ matrix.config }}
just move-rust-guests ${{ matrix.config }}
just build-rust-guests ${{ inputs.config }}
just move-rust-guests ${{ inputs.config }}

- name: Build c guests
run: |
# use these commands in favor of build-and-move-c-guests to avoid building both configs
just build-c-guests ${{ matrix.config }}
just move-c-guests ${{ matrix.config }}
just build-c-guests ${{ inputs.config }}
just move-c-guests ${{ inputs.config }}

- name: Build
run: just build ${{ matrix.config }}
run: just build ${{ inputs.config }}
env:
TARGET_TRIPLE: ${{ inputs.target_triple }}

- name: Run Rust tests
env:
CARGO_TERM_COLOR: always
TARGET_TRIPLE: ${{ inputs.target_triple }}
run: |
# with default features
just test ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
just test ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}

# with only one driver enabled (driver mshv/kvm feature is ignored on windows) + seccomp
just test ${{ matrix.config }} seccomp,${{ matrix.hypervisor == 'mshv' && 'mshv2' || matrix.hypervisor == 'mshv3' && 'mshv3' || 'kvm' }}
just test ${{ inputs.config }} seccomp,${{ inputs.hypervisor == 'mshv' && 'mshv2' || inputs.hypervisor == 'mshv3' && 'mshv3' || 'kvm' }}

# make sure certain cargo features compile
cargo check -p hyperlight-host --features crashdump
cargo check -p hyperlight-host --features print_debug
cargo check -p hyperlight-host --features gdb
cargo check -p hyperlight-host --features trace_guest,unwind_guest,mem_profile
just check

# without any features
just test-compilation-no-default-features ${{ matrix.config }}
just test-compilation-no-default-features ${{ inputs.config }}

# One of the examples is flaky on Windows GH runners, so this allows us to disable it for now
- name: Run Rust examples - windows
if: ${{ (runner.os == 'Windows') }}
env:
CARGO_TERM_COLOR: always
RUST_LOG: debug
run: just run-rust-examples ${{ matrix.config }}
TARGET_TRIPLE: ${{ inputs.target_triple }}
run: just run-rust-examples ${{ inputs.config }}


- name: Run Rust examples - linux
if: ${{ (runner.os != 'Windows') }}
if: false
env:
CARGO_TERM_COLOR: always
RUST_LOG: debug
run: just run-rust-examples-linux ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
TARGET_TRIPLE: ${{ inputs.target_triple }}
run: just run-rust-examples-linux ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}

- name: Run Rust Gdb tests - linux
if: runner.os == 'Linux'
env:
CARGO_TERM_COLOR: always
RUST_LOG: debug
run: just test-rust-gdb-debugging ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
TARGET_TRIPLE: ${{ inputs.target_triple }}
run: just test-rust-gdb-debugging ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}

- name: Run Rust Crashdump tests
env:
CARGO_TERM_COLOR: always
RUST_LOG: debug
run: just test-rust-crashdump ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
TARGET_TRIPLE: ${{ inputs.target_triple }}
run: just test-rust-crashdump ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}

- name: Run Rust Tracing tests - linux
if: runner.os == 'Linux'
env:
CARGO_TERM_COLOR: always
RUST_LOG: debug
run: just test-rust-tracing ${{ matrix.config }} ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
TARGET_TRIPLE: ${{ inputs.target_triple }}
run: just test-rust-tracing ${{ inputs.config }} ${{ inputs.hypervisor == 'mshv' && 'mshv2' || '""'}}

- name: Download benchmarks from "latest"
run: just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu}} dev-latest # compare to prerelease
run: just bench-download ${{ runner.os }} ${{ inputs.hypervisor }} ${{ inputs.cpu}} dev-latest # compare to prerelease
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
if: ${{ matrix.config == 'release' }}
if: ${{ inputs.config == 'release' && inputs.target_triple == '' }}

- name: Run benchmarks
run: |
just bench-ci main ${{ matrix.hypervisor == 'mshv' && 'mshv2' || ''}}
if: ${{ matrix.config == 'release' }}
just bench-ci main ${{ inputs.hypervisor == 'mshv' && 'mshv2' || ''}}
if: ${{ inputs.config == 'release' && inputs.target_triple == '' }}
9 changes: 9 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build]
pre-build = [
"apt-get update && apt-get -y install gdb"
]

[build.env]
passthrough = [
"TARGET_TRIPLE", # Some tests invoke Cargo directly and need this to run correctly
]
Loading
Loading