Merge pull request #7101 from dborquez/add_initial_metrics_gh_workflow

gha: ci-on-push: Run metrics tests
This commit is contained in:
GabyCT 2023-06-15 10:08:56 -06:00 committed by GitHub
commit 0f24f427d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 0 deletions

View File

@ -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

View File

@ -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

35
tests/metrics/gha-run.sh Executable file
View File

@ -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 "$@"