-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (61 loc) · 1.83 KB
/
Copy pathci.yml
File metadata and controls
65 lines (61 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Golang
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Run pre-commit
uses: pre-commit/action@v3.0.1
test:
runs-on: ubuntu-latest
container:
image: ghcr.io/aibor/virtrun-test:${{ matrix.arch }}
strategy:
matrix:
arch:
- amd64
- arm64
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Golang
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Download kernel modules
working-directory: /kernel
# Downloading not only the modules but also the kernel again to make
# sure they stem from the exact same version.
run: |
apk fetch --arch ${{ matrix.arch }} --no-cache --allow-untrusted linux-virt
tar xf linux-virt-*.apk --wildcards --transform='s,.*/,,' \
'boot/vmlinuz-virt' \
'lib/modules/*/kernel/drivers/net/tap.ko.gz' \
'lib/modules/*/kernel/drivers/vhost/vhost_iotlb.ko.gz' \
'lib/modules/*/kernel/drivers/vhost/vhost.ko.gz' \
'lib/modules/*/kernel/drivers/vhost/vhost_net.ko.gz'
rm linux-virt-*.apk
- name: Run tests
env:
GOARCH: ${{ matrix.arch }}
VIRTRUN_ARGS: >
-kernel /kernel/vmlinuz-virt
-addModule /kernel/tap.ko.gz
-addModule /kernel/vhost_iotlb.ko.gz
-addModule /kernel/vhost.ko.gz
-addModule /kernel/vhost_net.ko.gz
-transport pci
-verbose
run: go test -v -exec "go tool virtrun" ./...