Skip to content

Configure CI

Configure CI #3

Workflow file for this run

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
run: |
apk fetch --no-cache --allow-untrusted linux-virt
tar xf linux-virt-*.apk --wildcards --transform='s,.*/,,' \
'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:
VIRTRUN_ARGS: >
$VIRTRUN_ARGS
-addModule /kernel/tap.ko.gz
-addModule /kernel/vhost_iotlb.ko.gz
-addModule /kernel/vhost.ko.gz
-addModule /kernel/vhost_net.ko.gz
-verbose
run: go test -v -exec "go tool virtrun" ./...