diff --git a/.github/workflows/ci-on-push.yaml b/.github/workflows/ci-on-push.yaml index 3951bba081..819a9b33c8 100644 --- a/.github/workflows/ci-on-push.yaml +++ b/.github/workflows/ci-on-push.yaml @@ -52,3 +52,7 @@ jobs: registry: ghcr.io repo: ${{ github.repository_owner }}/kata-deploy-ci tag: ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-amd64 + + run-metrics-tests: + needs: build-kata-static-tarball-amd64 + uses: ./.github/workflows/run-launchtimes-metrics.yaml diff --git a/.github/workflows/run-launchtimes-metrics.yaml b/.github/workflows/run-launchtimes-metrics.yaml new file mode 100644 index 0000000000..67045acf26 --- /dev/null +++ b/.github/workflows/run-launchtimes-metrics.yaml @@ -0,0 +1,15 @@ +name: CI | Run launch-times metrics +on: + workflow_call: + +jobs: + launch-times-tests: + runs-on: metrics + env: + GOPATH: ${{ github.workspace }} + steps: + - name: run launch times on qemu + run: bash tests/metrics/gha-run.sh run-test-launchtimes-qemu + + - name: run launch times on clh + run: bash tests/metrics/gha-run.sh run-test-launchtimes-clh diff --git a/tests/metrics/gha-run.sh b/tests/metrics/gha-run.sh new file mode 100755 index 0000000000..e3656b2cde --- /dev/null +++ b/tests/metrics/gha-run.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# Copyright (c) 2023 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -o errexit +set -o nounset +set -o pipefail + +metrics_dir="$(dirname "$(readlink -f "$0")")" + +function run_test_launchtimes() { + hypervisor="${1}" + + echo "Running launchtimes tests: " + + if [ "${hypervisor}" = 'qemu' ]; then + echo "qemu" + elif [ "${hypervisor}" = 'clh' ]; then + echo "clh" + fi +} + +function main() { + action="${1:-}" + case "${action}" in + run-test-launchtimes-qemu) run_test_launchtimes "qemu" ;; + run-test-launchtimes-clh) run_test_launchtimes "clh" ;; + *) >&2 echo "Invalid argument"; exit 2 ;; + esac +} + +main "$@"