From 438fe3b8297dba0ecec8f8851f761fd66b1f8d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Wed, 12 Jul 2023 18:01:22 +0200 Subject: [PATCH] gha: ci: Add cri-containerd tests skeleton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR builds the foundation for us to start migrating the cri-containerd tests from Jenkins to GitHub Actions. Right now the test does nothing and should always finish successfully. The coming PRs will actually introduce logic to the `gha-run.sh` script where we'll be able to run the tests and make sure those pass before having them actually merged. Fixes: #6543 Signed-off-by: Fabiano FidĂȘncio --- .github/workflows/ci.yaml | 7 ++++ .../workflows/run-cri-containerd-tests.yaml | 36 +++++++++++++++++++ tests/integration/cri-containerd/gha-run.sh | 32 +++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 .github/workflows/run-cri-containerd-tests.yaml create mode 100755 tests/integration/cri-containerd/gha-run.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c0c2074bbd..151c8fe877 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -74,3 +74,10 @@ jobs: with: tarball-suffix: -${{ inputs.tag }} commit-hash: ${{ inputs.commit-hash }} + + run-cri-containerd-tests: + needs: build-kata-static-tarball-amd64 + uses: ./.github/workflows/run-cri-containerd-tests.yaml + with: + tarball-suffix: -${{ inputs.tag }} + commit-hash: ${{ inputs.commit-hash }} diff --git a/.github/workflows/run-cri-containerd-tests.yaml b/.github/workflows/run-cri-containerd-tests.yaml new file mode 100644 index 0000000000..4dd54fcb14 --- /dev/null +++ b/.github/workflows/run-cri-containerd-tests.yaml @@ -0,0 +1,36 @@ +name: CI | Run cri-containerd tests +on: + workflow_call: + inputs: + tarball-suffix: + required: false + type: string + commit-hash: + required: false + type: string + +jobs: + run-cri-containerd: + strategy: + fail-fast: true + matrix: + vmm: ['clh', 'qemu'] + runs-on: garm-ubuntu-2204 + env: + KATA_HYPERVSIOR: ${{ matrix.vmm }} + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ inputs.commit-hash }} + + - name: get-kata-tarball + uses: actions/download-artifact@v3 + with: + name: kata-static-tarball-amd64${{ inputs.tarball-suffix }} + path: kata-artifacts + + - name: Install kata + run: bash tests/integration/cri-containerd/gha-run.sh install-kata kata-artifacts + + - name: Run cri-containerd tests + run: bash tests/integration/cri-containerd/gha-run.sh run diff --git a/tests/integration/cri-containerd/gha-run.sh b/tests/integration/cri-containerd/gha-run.sh new file mode 100755 index 0000000000..cf25000489 --- /dev/null +++ b/tests/integration/cri-containerd/gha-run.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# Copyright (c) 2023 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -o errexit +set -o nounset +set -o pipefail + +kata_tarball_dir="${2:-kata-artifacts}" +cri_containerd_dir="$(dirname "$(readlink -f "$0")")" +source "${cri_containerd_dir}/../../common.bash" + +function run() { + info "Running cri-containerd tests using ${KATA_HYPERVISOR} hypervisor" + + create_symbolic_links ${KATA_HYPERVISOR} + return 0 +} + +function main() { + action="${1:-}" + case "${action}" in + install-kata) install_kata ;; + run) run ;; + *) >&2 die "Invalid argument" ;; + esac +} + +main "$@"