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
28 changes: 0 additions & 28 deletions .cirrus.yml

This file was deleted.

39 changes: 13 additions & 26 deletions .github/workflows/code_quality-aarch64-darwin.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,29 @@
name: Code Quality (rustfmt and clippy)
name: macOS-aarch64
on: [pull_request, create]

jobs:
build:
if: github.event_name == 'pull_request'
name: Code Quality (clippy, rustfmt)
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
target:
- aarch64-apple-darwin
name: Code Quality (fmt, clippy)
runs-on: macos-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Install Rust toolchain (${{ matrix.rust }})
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
toolchain: stable
components: rustfmt, clippy

- name: Create a fake init
run: touch init/init
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Install dependencies
run: brew tap slp/krunkit && brew install virglrenderer

- name: Formatting (rustfmt)
run: cargo fmt -- --check

- name: Clippy (default features)
run: cargo clippy --target aarch64-apple-darwin -- -D warnings

- name: Clippy (net feature)
run: cargo clippy --target aarch64-apple-darwin --features net -- -D warnings

- name: Clippy (blk feature)
run: cargo clippy --target aarch64-apple-darwin --features blk -- -D warnings

- name: Clippy (efi(blk+net) feature)
run: cargo clippy --target aarch64-apple-darwin --features efi -- -D warnings
- name: Formatting (rustfmt)
run: cargo clippy --features efi,gpu -- -D warnings
18 changes: 5 additions & 13 deletions .github/workflows/code_quality-aarch64.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
name: Code Quality (rustfmt and clippy)
name: linux-aarch64
on: [pull_request, create]

jobs:
build:
if: github.event_name == 'pull_request'
name: Code Quality (clippy, rustfmt)
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
target:
- aarch64-unknown-linux-gnu
name: Code Quality (fmt, clippy)
runs-on: ubuntu-24.04-arm
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Install Rust toolchain (${{ matrix.rust }})
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
toolchain: stable
components: rustfmt, clippy

- name: Install packages
Expand Down
74 changes: 62 additions & 12 deletions .github/workflows/code_quality-x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
name: Code Quality (rustfmt and clippy)
name: linux-x86_64
on: [pull_request, create]

jobs:
build:
if: github.event_name == 'pull_request'
name: Code Quality (clippy, rustfmt)
name: Code Quality (fmt, clippy)
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
target:
- x86_64-unknown-linux-gnu
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Install Rust toolchain (${{ matrix.rust }})
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
toolchain: stable
components: rustfmt, clippy

- name: Install packages
Expand All @@ -40,3 +32,61 @@ jobs:

- name: Clippy (net+blk+gpu+snd features)
run: cargo clippy --features net,blk,gpu,snd -- -D warnings

unit:
if: github.event_name == 'pull_request'
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy

- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
sudo usermod -a -G kvm $USER

- name: Install packages
run: sudo apt-get update && sudo apt-get install -y libvirglrenderer-dev libepoxy-dev libdrm-dev libpipewire-0.3-dev

- name: Create a fake init
run: touch init/init

- name: Unit tests
run: cargo test

integration:
if: github.event_name == 'pull_request'
name: Integration Tests
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-musl

- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
sudo usermod -a -G kvm $USER

- name: Install packages
run: sudo apt-get update && sudo apt-get install -y build-essential patchelf libclang-dev pkg-config net-tools libvirglrenderer-dev libepoxy-dev libdrm-dev libpipewire-0.3-dev

- name: Install libkrunfw
run: curl -L -o /tmp/libkrunfw-4.9.0-x86_64.tgz https://github.com/containers/libkrunfw/releases/download/v4.9.0/libkrunfw-4.9.0-x86_64.tgz && mkdir tmp && tar xf /tmp/libkrunfw-4.9.0-x86_64.tgz -C tmp && sudo mv tmp/lib64/* /lib/x86_64-linux-gnu

- name: Integration tests
run: KRUN_NO_UNSHARE=1 make test
2 changes: 1 addition & 1 deletion tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cargo build -p runner

export KRUN_TEST_GUEST_AGENT_PATH="target/$GUEST_TARGET_ARCH/debug/guest-agent"

if which unshare 2>&1 >/dev/null; then
if [ -z "${KRUN_NO_UNSHARE}" ] && which unshare 2>&1 >/dev/null; then
unshare --user --map-root-user --net -- /bin/sh -c "ifconfig lo 127.0.0.1 && exec target/debug/runner $@"
else
echo "WARNING: Running tests without a network namespace."
Expand Down
Loading