-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TODO: - separate vmtests infra in a different file - add more kernels
- Loading branch information
1 parent
85c6d31
commit f8a61af
Showing
4 changed files
with
185 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: release | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@main | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
|
||
- name: Set up nix dev env | ||
run: nix develop --command echo 0 | ||
|
||
- name: Build `lightswitch` statically linked using glibc | ||
run: nix develop --command bash -c 'RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target x86_64-unknown-linux-gnu' | ||
|
||
- name: Run vmtests | ||
run: nix develop --command run-vmtests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/target | ||
flame.svg | ||
src/bpf/*_skel.rs | ||
.vmtest.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ lib, inputs, nixpkgs, home-manager, user, location, ... }: | ||
|
||
kernel_6_6 = pkgs.stdenv.mkDerivation { | ||
name = "download-kernel-6.6"; | ||
src = pkgs.fetchurl { | ||
url = "https://github.com/danobi/vmtest/releases/download/test_assets/bzImage-v6.6-fedora38"; | ||
hash = "sha256-6Fu16SPBITP0sI3lapkckZna6GKBn2hID038itt82jA="; | ||
}; | ||
dontUnpack = true; | ||
installPhase = '' | ||
mkdir -p $out | ||
cp -r $src $out/bzImage | ||
''; | ||
}; | ||
vmtest = pkgs.rustPlatform.buildRustPackage { | ||
name = "vmtest"; | ||
src = pkgs.fetchFromGitHub { | ||
owner = "danobi"; | ||
repo = "vmtest"; | ||
rev = "51f11bf301fea054342996802a16ed21fb5054f4"; | ||
sha256 = "sha256-qtTq0dnDHi1ITfQzKrXz+1dRMymAFBivWpjXntD09+A="; | ||
}; | ||
cargoHash = "sha256-SHjjCWz4FVVk1cczkMltRVEB3GK8jz2tVABNSlSZiUc="; | ||
nativeBuildInputs = [ pkgs.qemu ]; | ||
doCheck = false; | ||
|
||
meta = with pkgs.lib; { | ||
description = ""; | ||
homepage = ""; | ||
license = licenses.agpl3Only; | ||
mainProgram = ""; | ||
maintainers = with maintainers; [ ]; | ||
platforms = platforms.linux; | ||
}; | ||
}; | ||
|
||
|
||
vmtest-run = pkgs.stdenv.mkDerivation { | ||
name = "vmtest-dump-config"; | ||
dontUnpack = true; | ||
|
||
src = pkgs.writeText "vmtest.toml" '' | ||
[[target]] | ||
name = "6.6" | ||
kernel = "${kernel_6_6.out}/bzImage" | ||
command = "/home/javierhonduco/code/lightswitch/target/x86_64-unknown-linux-gnu/debug/lightswitch --duration 2" | ||
''; | ||
nativeBuildInputs = [ vmtest kernel_6_6 ]; | ||
installPhase = '' | ||
mkdir -p $out | ||
cp -r $src $out/ | ||
''; | ||
}; | ||
|
||
runvmtests = pkgs.stdenv.mkDerivation { | ||
name = "run-vm-tests"; | ||
dontUnpack = true; | ||
|
||
src = pkgs.writeText "run-vmtests" '' | ||
vmtest --config ${vmtest-run} | ||
''; | ||
nativeBuildInputs = [ vmtest-run ]; | ||
installPhase = '' | ||
mkdir -p $out | ||
cp -r $src $out/ | ||
''; | ||
}; |