Skip to content

Commit 89bf7a0

Browse files
committed
ci: consolidate integration tests on github runners
GitHub runners support nested virtualization (only on x86_64), so consolidate the integration and unit tests on them to simplify the workflows. Signed-off-by: Sergio Lopez <[email protected]>
1 parent dd4fedc commit 89bf7a0

File tree

1 file changed

+55
-12
lines changed

1 file changed

+55
-12
lines changed
Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
1-
name: Code Quality (rustfmt and clippy)
1+
name: linux-x86_64
22
on: [pull_request, create]
33

44
jobs:
55
build:
66
if: github.event_name == 'pull_request'
7-
name: Code Quality (clippy, rustfmt)
7+
name: Code Quality (fmt, clippy)
88
runs-on: ubuntu-latest
9-
strategy:
10-
matrix:
11-
rust:
12-
- stable
13-
target:
14-
- x86_64-unknown-linux-gnu
159
steps:
1610
- name: Code checkout
1711
uses: actions/checkout@v2
18-
- name: Install Rust toolchain (${{ matrix.rust }})
12+
- name: Install Rust toolchain
1913
uses: actions-rs/toolchain@v1
2014
with:
21-
toolchain: ${{ matrix.rust }}
22-
target: ${{ matrix.target }}
23-
override: true
15+
toolchain: stable
2416
components: rustfmt, clippy
2517

2618
- name: Install packages
@@ -40,3 +32,54 @@ jobs:
4032

4133
- name: Clippy (net+blk+gpu+snd features)
4234
run: cargo clippy --features net,blk,gpu,snd -- -D warnings
35+
36+
unit:
37+
if: github.event_name == 'pull_request'
38+
name: Unit Tests
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Code checkout
42+
uses: actions/checkout@v2
43+
- name: Install Rust toolchain
44+
uses: actions-rs/toolchain@v1
45+
with:
46+
toolchain: stable
47+
components: rustfmt, clippy
48+
49+
- name: Install packages
50+
run: sudo apt-get update && sudo apt-get install -y libvirglrenderer-dev libepoxy-dev libdrm-dev libpipewire-0.3-dev
51+
52+
- name: Create a fake init
53+
run: touch init/init
54+
55+
- name: Unit tests
56+
run: cargo test
57+
58+
integration:
59+
if: github.event_name == 'pull_request'
60+
name: Integration Tests
61+
runs-on: ubuntu-latest
62+
steps:
63+
- name: Code checkout
64+
uses: actions/checkout@v2
65+
- name: Install Rust toolchain
66+
uses: actions-rs/toolchain@v1
67+
with:
68+
toolchain: stable
69+
target: x86_64-unknown-linux-musl
70+
71+
- name: Enable KVM group perms
72+
run: |
73+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
74+
sudo udevadm control --reload-rules
75+
sudo udevadm trigger --name-match=kvm
76+
sudo usermod -a -G kvm $USER
77+
78+
- name: Install packages
79+
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
80+
81+
- name: Install libkrunfw
82+
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
83+
84+
- name: Integration tests
85+
run: KRUN_NO_UNSHARE=1 make test

0 commit comments

Comments
 (0)