diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d7245a8439..52a86b08d3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -88,3 +88,10 @@ jobs: with: tarball-suffix: -${{ inputs.tag }} commit-hash: ${{ inputs.commit-hash }} + + run-vfio-tests: + needs: build-kata-static-tarball-amd64 + uses: ./.github/workflows/run-vfio-tests.yaml + with: + tarball-suffix: -${{ inputs.tag }} + commit-hash: ${{ inputs.commit-hash }} diff --git a/.github/workflows/run-vfio-tests.yaml b/.github/workflows/run-vfio-tests.yaml new file mode 100644 index 0000000000..ba34d20889 --- /dev/null +++ b/.github/workflows/run-vfio-tests.yaml @@ -0,0 +1,37 @@ +name: CI | Run vfio tests +on: + workflow_call: + inputs: + tarball-suffix: + required: false + type: string + commit-hash: + required: false + type: string + +jobs: + run-vfio: + strategy: + fail-fast: false + matrix: + vmm: ['clh', 'qemu'] + runs-on: garm-ubuntu-2204 + env: + GOPATH: ${{ github.workspace }} + KATA_HYPERVISOR: ${{ matrix.vmm }} + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ inputs.commit-hash }} + + - name: Install dependencies + run: bash tests/functional/vfio/gha-run.sh install-dependencies + + - name: get-kata-tarball + uses: actions/download-artifact@v3 + with: + name: kata-static-tarball-amd64${{ inputs.tarball-suffix }} + path: kata-artifacts + + - name: Run vfio tests + run: bash tests/functional/vfio/gha-run.sh run diff --git a/tests/functional/vfio/gha-run.sh b/tests/functional/vfio/gha-run.sh new file mode 100755 index 0000000000..f4cb608de6 --- /dev/null +++ b/tests/functional/vfio/gha-run.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# Copyright (c) Microsoft Corporation. +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -o errexit +set -o nounset +set -o pipefail + +kata_tarball_dir="${2:-kata-artifacts}" +vfio_dir="$(dirname "$(readlink -f "$0")")" +source "${vfio_dir}/../../common.bash" + +function install_dependencies() { + info "Installing the dependencies needed for running the vfio tests" +} + +function run() { + info "Running cri-containerd tests using ${KATA_HYPERVISOR} hypervisor" +} + +function main() { + action="${1:-}" + case "${action}" in + install-dependencies) install_dependencies ;; + run) run ;; + *) >&2 die "Invalid argument" ;; + esac +} + +main "$@"