Skip to content
Merged
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
17 changes: 16 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ env:


jobs:
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Check build
run: cargo check --all-targets

- name: Run unit tests
run: cargo test --lib

build:
runs-on: ubuntu-24.04

Expand Down Expand Up @@ -181,10 +195,11 @@ jobs:
# Sentinel job for required checks - configure this job name in repository settings
required-checks:
if: always()
needs: [build, integration-tests]
needs: [build-macos, build, integration-tests]
runs-on: ubuntu-latest
steps:
- run: exit 1
if: >-
needs.build-macos.result != 'success' ||
needs.build.result != 'success' ||
needs.integration-tests.result != 'success'
16 changes: 8 additions & 8 deletions Cargo.lock

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

21 changes: 12 additions & 9 deletions crates/kit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ edition = "2021"
publish = false

[dependencies]
bcvk-qemu = { path = "../bcvk-qemu" }
base64 = "0.22"
# For some recent APIs, TODO switch back to published version
cap-std-ext = { git = "https://github.com/coreos/cap-std-ext", rev = "cfdb25d51ffc697e70aa0d8d3cefe9ec2133bd0a" }
chrono = { version = "0.4", features = ["serde"] }
const_format = { workspace = true }
color-eyre = { workspace = true }
Expand All @@ -17,12 +14,9 @@ clap_mangen = { version = "0.2.20", optional = true }
data-encoding = { version = "2.9" }
dirs = "5.0"
fn-error-context = { version = "0.2" }
bootc-mount = { git = "https://github.com/bootc-dev/bootc", rev = "93b22f4dbc2d54f7cca7c1df3ee59fcdec0b2cf1" }
bootc-utils = { git = "https://github.com/bootc-dev/bootc", rev = "93b22f4dbc2d54f7cca7c1df3ee59fcdec0b2cf1" }
indicatif = "0.17"
notify = "6.1"
thiserror = "1.0"
rustix = { "version" = "1", features = ["thread", "net", "fs", "pipe", "system", "process", "mount"] }
serde = { version = "1.0.199", features = ["derive"] }
serde_json = "1.0.116"
serde_yaml = "0.9"
Expand All @@ -41,9 +35,6 @@ cfg-if = { workspace = true }
indoc = "2.0.6"
regex = "1.10"
itertools = "0.14.0"
vsock = "0.5"
nix = { version = "0.29", features = ["socket"] }
libc = "0.2"
camino = "1.1.12"
comfy-table = "7.1"
strum = { version = "0.26", features = ["derive"] }
Expand All @@ -53,6 +44,18 @@ sha2 = "0.10"
which = "7.0"
cpio = "0.4"

# Linux-only dependencies
[target.'cfg(target_os = "linux")'.dependencies]
bcvk-qemu = { path = "../bcvk-qemu" }
# For some recent APIs, TODO switch back to published version
cap-std-ext = { git = "https://github.com/coreos/cap-std-ext", rev = "cfdb25d51ffc697e70aa0d8d3cefe9ec2133bd0a" }
bootc-mount = { git = "https://github.com/bootc-dev/bootc", rev = "93b22f4dbc2d54f7cca7c1df3ee59fcdec0b2cf1" }
bootc-utils = { git = "https://github.com/bootc-dev/bootc", rev = "93b22f4dbc2d54f7cca7c1df3ee59fcdec0b2cf1" }
rustix = { version = "1", features = ["thread", "net", "fs", "pipe", "system", "process", "mount"] }
vsock = "0.5"
nix = { version = "0.29", features = ["socket"] }
libc = "0.2"

[dev-dependencies]
similar-asserts = "1.5"

Expand Down
3 changes: 3 additions & 0 deletions crates/kit/src/cpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
//! The Linux kernel supports concatenating multiple CPIO archives,
//! so we can simply append our files to an existing initramfs.

// On non-Linux, this module is unused as it's for initramfs manipulation
#![cfg_attr(not(target_os = "linux"), allow(dead_code))]

use std::io::{self, Write};

use cpio::newc::Builder as NewcBuilder;
Expand Down
3 changes: 3 additions & 0 deletions crates/kit/src/install_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
//! operations, ensuring consistency across to-disk, libvirt-upload-disk,
//! and other installation-related commands.

// On non-Linux, this module is unused as it's for installation operations
#![cfg_attr(not(target_os = "linux"), allow(dead_code))]

use camino::Utf8PathBuf;
use clap::Parser;

Expand Down
3 changes: 3 additions & 0 deletions crates/kit/src/instancetypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
//!
//! Source: https://github.com/kubevirt/common-instancetypes

// On non-Linux, this module is unused as it's for VM instance types
#![cfg_attr(not(target_os = "linux"), allow(dead_code))]

/// Instance type variants with associated vCPU and memory specifications
///
/// Source: https://github.com/kubevirt/common-instancetypes/blob/main/instancetypes/u/1/sizes.yaml
Expand Down
5 changes: 4 additions & 1 deletion crates/kit/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//! bcvk library - exposes internal modules for testing

pub mod cpio;
pub mod kernel;
pub mod qemu_img;
pub mod xml_utils;

// Linux-only modules
#[cfg(target_os = "linux")]
pub mod kernel;
Loading