Skip to content

Jag/iommufd

Jag/iommufd #161

Workflow file for this run

name: build
on:
push:
branches: [ main, next, staging ]
pull_request:
branches: [ main, next ]
jobs:
sanity:
name: "basic sanity build"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: checkout libnvme
uses: actions/checkout@v3
with:
repository: linux-nvme/libnvme
path: libnvme
ref: v1.4
- name: install build dependencies
run: sudo pip install meson ninja sphinx sphinx-rtd-theme
- name: compile and install libnvme
run: |
cd libnvme
make
sudo make install
- name: configure build
run: meson setup build
- name: compile
run: meson compile -C build
- name: unit tests
run: |
meson test -C build libvfn:
- name: configure release build
run: meson setup --reconfigure build --buildtype=release
- name: compile
run: meson compile -C build
- name: unit tests
run: |
meson test -C build libvfn:
sparse:
name: "run sparse"
needs: [sanity]
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: install build dependencies
run: sudo pip install meson ninja
- name: install sparse
run: sudo apt-get -y install sparse
- name: configure build
run: meson setup build
- name: run sparse
run: meson compile -C build sparse
scan-build:
name: "run scan-build"
needs: [sanity]
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: install build dependencies
run: sudo pip install meson ninja
- name: install scan-build
run: sudo apt-get -y install clang-tools
- name: configure build
run: meson setup build
- name: run scan-build
run: scan-build -o /tmp/scan-build-report --status-bugs ninja -C build
- name: grab bug report
uses: actions/upload-artifact@v3
if: failure()
with:
name: scan-build-report
path: /tmp/scan-build-report/*
cc-builds:
name: "compiler builds"
needs: [sanity]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
steps:
- name: checkout
uses: actions/checkout@v3
- name: install build dependencies
run: sudo pip install meson ninja
- name: configure build
run: CC=${{ matrix.compiler }} meson setup build -Dlibnvme=disabled
- name: compile
run: meson compile -C build
dist-builds:
name: "distribution builds"
needs: [sanity]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
container:
- {os: 'almalinux', ver: '8'}
- {os: 'almalinux', ver: '9'}
- {os: 'alpine', ver: 'latest'}
- {os: 'archlinux', ver: 'latest'}
- {os: 'debian', ver: 'trixie'}
- {os: 'debian', ver: 'bookworm'}
- {os: 'debian', ver: 'bullseye'}
- {os: 'debian', ver: 'buster'}
- {os: 'fedora', ver: 'rawhide'}
- {os: 'fedora', ver: '38'}
- {os: 'fedora', ver: '37'}
- {os: 'rockylinux', ver: '8'}
- {os: 'rockylinux', ver: '9'}
- {os: 'ubuntu', ver: 'mantic'}
- {os: 'ubuntu', ver: 'lunar'}
- {os: 'ubuntu', ver: 'jammy'}
- {os: 'ubuntu', ver: 'focal'}
container:
image: ${{ matrix.container.os }}:${{ matrix.container.ver }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: install dependencies
env:
SETUP_SCRIPT: .github/scripts/build/${{ matrix.container.os}}-setup-${{ matrix.container.ver }}.sh
run: ${SETUP_SCRIPT}
- name: configure build
run: meson setup build -Dlibnvme=disabled
- name: compile
run: ninja -C build
- name: upload log
uses: actions/upload-artifact@v3
if: failure()
with:
name: meson log
path: build/meson-logs/meson-log.txt
- name: unit tests
run: meson test -C build "libvfn:"
device-test:
name: "run emulated nvme device tests"
needs: [sanity]
runs-on: [self-hosted, kvm]
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || ((github.event_name == 'pull_request') && contains(github.event.pull_request.labels.*.name, 'approved'))
env:
VMCTL_VMROOT: "/scratch/ghr/guests"
VMCONFIG: ".github/vmconfig/null.conf"
QEMU_SYSTEM_BINARY: "/usr/bin/qemu-system-x86_64"
steps:
- name: checkout libvfn
uses: actions/checkout@v3
- name: create dist package
run: |
meson setup build
meson dist -C build --no-tests
- name: reset vm
run: |
vmctl -c "$VMCONFIG" kill || true
rm -f "${VMCTL_VMROOT}/img/null.qcow2"
- name: launch vm
run: |
vmctl -c "$VMCONFIG" run --background
vmctl -c "$VMCONFIG" ssh -w -- echo vm is up
- name: copy source
run: |
scp -P 2222 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null build/meson-dist/libvfn-*.tar.xz root@localhost:
- name: build
run: |
vmctl -c "$VMCONFIG" ssh -- -T <<EOF
mkdir libvfn
tar -Jxf libvfn-*.tar.xz -C libvfn --strip 1
cd libvfn
meson setup build
ninja -C build
EOF
- name: setup device
run: |
vmctl -c "$VMCONFIG" ssh -- -T <<EOF
modprobe vfio-pci
cd libvfn
./build/tools/vfntool/vfntool -v -d 0000:01:00.0
EOF
- name: run tests
run: |
vmctl -c "$VMCONFIG" ssh -- -T <<EOF
cd libvfn
meson test -C build libvfn: --suite device --test-args "-d 0000:01:00.0 -N 1"
EOF
- name: shutdown vm
if: always()
run: vmctl -c "$VMCONFIG" kill