Skip to content

Commit

Permalink
[GHA] Artifact folder names consistency check (openvinotoolkit#26538)
Browse files Browse the repository at this point in the history
### Details:
To avoid sudden breaking of CI's in repos retrieving these artifacts via
OV provider or Jenkins

### Tickets:
 - 152261
  • Loading branch information
akladiev authored Sep 11, 2024
1 parent 90d1219 commit 05bd0c7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/actions/common/artifact_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import argparse
import os
from pathlib import Path
from .constants import EventType
from .constants import EventType, ProductType


def add_common_args(parser: argparse.ArgumentParser):
Expand All @@ -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'))

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


Expand Down
14 changes: 13 additions & 1 deletion .github/actions/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

0 comments on commit 05bd0c7

Please sign in to comment.