Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[GHA] Artifact folder names consistency check (#26538)

Alina Kladieva05bd0c79f922
diff --git a/.github/actions/common/artifact_utils.py b/.github/actions/common/artifact_utils.py
index 08ebdf60795..b5e95c65d52 100644
--- a/.github/actions/common/artifact_utils.py
+++ b/.github/actions/common/artifact_utils.py
@@ -3,7 +3,7 @@ from __future__ import annotations
import argparse
import os
from pathlib import Path
-from .constants import EventType
+from .constants import EventType, ProductType
def add_common_args(parser: argparse.ArgumentParser):
@@ -12,7 +12,8 @@ def add_common_args(parser: argparse.ArgumentParser):
default=os.getenv('GITHUB_BASE_REF') or os.getenv('GITHUB_REF_NAME'))
parser.add_argument('-e', '--event_name', help='Name of GitHub event', required=False,
default=os.getenv('GITHUB_EVENT_NAME'))
- parser.add_argument('--storage_dir', help='Subdirectory name for artifacts, same as product type', required=True)
+ parser.add_argument('--storage_dir', help='Subdirectory name for artifacts, same as product type', required=True,
+ choices=[product_type.value for product_type in ProductType])
parser.add_argument('--storage_root', help='Root path of the artifacts storage', required=False,
default=os.getenv('ARTIFACTS_SHARE'))
@@ -39,7 +40,7 @@ def get_storage_dir(product_type: str, commit_hash: str, storage_root: str | Pat
# branch_name = merge_queue_matcher.group(1)
storage_event_dir = get_storage_event_dir(storage_root, branch_name, event_name, product_name)
- storage = storage_event_dir / commit_hash / product_type
+ storage = storage_event_dir / commit_hash / product_type.lower()
return storage
diff --git a/.github/actions/common/constants.py b/.github/actions/common/constants.py
index 3ef641ff93d..01b705f1375 100644
--- a/.github/actions/common/constants.py
+++ b/.github/actions/common/constants.py
@@ -5,4 +5,16 @@ class EventType(Enum):
pre_commit = 'pre_commit'
commit = 'commit'
-# TODO: add enum for product type to validate it
+
+productTypes = (
+ 'public_linux_debian_10_arm_release',
+ 'public_linux_fedora_29_x86_64_release',
+ 'public_linux_ubuntu_20_04_x86_64_release',
+ 'public_linux_ubuntu_20_04_arm64_release',
+ 'public_linux_ubuntu_22_04_x86_64_release',
+ 'public_linux_ubuntu_22_04_dpcpp_x86_64_release',
+ 'public_linux_ubuntu_24_04_x86_64_release',
+ 'public_windows_vs2019_Release',
+ 'public_windows_vs2019_Debug',
+)
+ProductType = Enum('ProductType', {t.upper(): t for t in productTypes})