Skip to content

Commit

Permalink
Merge branch 'ci/upload_size_info_and_build_junit_report' into 'master'
Browse files Browse the repository at this point in the history
ci: upload size info, and build junit report

See merge request espressif/esp-idf!28803
  • Loading branch information
hfudev committed Feb 23, 2024
2 parents 00df222 + a1f7f94 commit 859bd52
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions tools/ci/artifacts_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class ArtifactType(str, Enum):
],
ArtifactType.JUNIT_REPORTS: [
'XUNIT_RESULT*.xml',
'build_summary*.xml',
],
ArtifactType.MODIFIED_FILES_AND_COMPONENTS_REPORT: [
'pipeline.env',
Expand Down
17 changes: 9 additions & 8 deletions tools/ci/idf_ci/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class AppUploader(AppDownloader):
ArtifactType.LOGS: [
DEFAULT_BUILD_LOG_FILENAME,
],
ArtifactType.SIZE_REPORTS: [
'**/build*/size.json',
],
}

def __init__(self, pipeline_id: t.Union[str, int, None] = None) -> None:
Expand Down Expand Up @@ -91,7 +94,6 @@ def _upload_app(self, app_build_path: str, artifact_type: ArtifactType) -> bool:
try:
if has_file:
obj_name = self.get_app_object_name(app_path, zip_filename, artifact_type)
print(f'Created archive file: {zip_filename}, uploading as {obj_name}')
self._client.fput_object(getenv('IDF_S3_BUCKET'), obj_name, zip_filename)
uploaded = True
finally:
Expand All @@ -101,14 +103,13 @@ def _upload_app(self, app_build_path: str, artifact_type: ArtifactType) -> bool:
def upload_app(self, app_build_path: str, artifact_type: t.Optional[ArtifactType] = None) -> None:
uploaded = False
if not artifact_type:
for _artifact_type in [
ArtifactType.MAP_AND_ELF_FILES,
ArtifactType.BUILD_DIR_WITHOUT_MAP_AND_ELF_FILES,
ArtifactType.LOGS,
]:
uploaded |= self._upload_app(app_build_path, _artifact_type)
upload_types: t.Iterable[ArtifactType] = self.TYPE_PATTERNS_DICT.keys()
else:
uploaded = self._upload_app(app_build_path, artifact_type)
upload_types = [artifact_type]

print(f'Uploading {app_build_path} {[k.value for k in upload_types]} to minio server')
for upload_type in upload_types:
uploaded |= self._upload_app(app_build_path, upload_type)

if uploaded:
rmdir(app_build_path, exclude_file_patterns=DEFAULT_BUILD_LOG_FILENAME)
Expand Down

0 comments on commit 859bd52

Please sign in to comment.