diff --git a/.gitlab/ci/build.yml b/.gitlab/ci/build.yml index e6decbb11d..be1761cb15 100644 --- a/.gitlab/ci/build.yml +++ b/.gitlab/ci/build.yml @@ -48,7 +48,8 @@ examples/wifi/iperf --modified-components ${MR_MODIFIED_COMPONENTS} --modified-files ${MR_MODIFIED_FILES} - - upload_artifacts_to_s3 + # for detailed documents, please refer to .gitlab/ci/README.md#uploaddownload-artifacts-to-internal-minio-server + - python tools/ci/artifacts_handler.py upload .build_cmake_clang_template: extends: @@ -67,7 +68,7 @@ --modified-components ${MR_MODIFIED_COMPONENTS} --modified-files ${MR_MODIFIED_FILES} $TEST_BUILD_OPTS_EXTRA - - upload_artifacts_to_s3 + - python tools/ci/artifacts_handler.py upload .build_pytest_template: extends: @@ -83,7 +84,7 @@ --collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt" --modified-components ${MR_MODIFIED_COMPONENTS} --modified-files ${MR_MODIFIED_FILES} - - upload_artifacts_to_s3 + - python tools/ci/artifacts_handler.py upload .build_pytest_no_jtag_template: extends: @@ -99,7 +100,7 @@ --collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt" --modified-components ${MR_MODIFIED_COMPONENTS} --modified-files ${MR_MODIFIED_FILES} - - upload_artifacts_to_s3 + - python tools/ci/artifacts_handler.py upload .build_pytest_jtag_template: extends: @@ -115,7 +116,7 @@ --collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt" --modified-components ${MR_MODIFIED_COMPONENTS} --modified-files ${MR_MODIFIED_FILES} - - upload_artifacts_to_s3 + - python tools/ci/artifacts_handler.py upload build_pytest_examples_esp32: extends: @@ -265,7 +266,7 @@ build_only_components_apps: --parallel-index ${CI_NODE_INDEX:-1} --modified-components ${MR_MODIFIED_COMPONENTS} --modified-files ${MR_MODIFIED_FILES} - - upload_artifacts_to_s3 + - python tools/ci/artifacts_handler.py upload build_pytest_test_apps_esp32: extends: @@ -337,7 +338,7 @@ build_only_tools_test_apps: --parallel-index ${CI_NODE_INDEX:-1} --modified-components ${MR_MODIFIED_COMPONENTS} --modified-files ${MR_MODIFIED_FILES} - - upload_artifacts_to_s3 + - python tools/ci/artifacts_handler.py upload .build_template_app_template: extends: diff --git a/.gitlab/ci/common.yml b/.gitlab/ci/common.yml index 3956df42ed..fbecbacab8 100644 --- a/.gitlab/ci/common.yml +++ b/.gitlab/ci/common.yml @@ -169,6 +169,12 @@ variables: # Show ccache statistics if enabled globally test "$CI_CCACHE_STATS" == 1 && test -n "$(which ccache)" && ccache --show-stats || true +.upload_failed_job_log_artifacts: &upload_failed_job_log_artifacts | + - | + if [ $CI_JOB_STATUS = "failed" ]; then + python tools/ci/artifacts_handler.py upload --type logs + fi + .before_script:minimal: before_script: - *common-before_scripts @@ -195,6 +201,7 @@ variables: .after_script:build:ccache: after_script: - *show_ccache_statistics + - *upload_failed_job_log_artifacts ############# # `default` # diff --git a/.gitlab/ci/target-test.yml b/.gitlab/ci/target-test.yml index b2fec6d540..7f1ebfcc21 100644 --- a/.gitlab/ci/target-test.yml +++ b/.gitlab/ci/target-test.yml @@ -12,6 +12,8 @@ paths: - .cache/pip policy: pull + after_script: + - python tools/ci/artifacts_handler.py upload --type logs junit_reports .pytest_template: extends: @@ -50,7 +52,6 @@ --parallel-index ${CI_NODE_INDEX:-1} ${PYTEST_EXTRA_FLAGS} --app-info-filepattern \"list_job_*.txt\" - - python tools/ci/artifacts_handler.py upload --type logs junit_reports .pytest_examples_dir_template: extends: .pytest_template @@ -1299,7 +1300,6 @@ pytest_examples_openthread_br: --parallel-index ${CI_NODE_INDEX:-1} ${PYTEST_EXTRA_FLAGS} --app-info-filepattern \"list_job_*.txt\" - - python tools/ci/artifacts_handler.py upload --type logs junit_reports pytest_examples_openthread_bbr: extends: @@ -1334,7 +1334,6 @@ pytest_examples_openthread_bbr: --parallel-index ${CI_NODE_INDEX:-1} ${PYTEST_EXTRA_FLAGS} --app-info-filepattern \"list_job_*.txt\" - - python tools/ci/artifacts_handler.py upload --type logs junit_reports pytest_examples_openthread_sleep: extends: @@ -1366,7 +1365,6 @@ pytest_examples_openthread_sleep: --parallel-index ${CI_NODE_INDEX:-1} ${PYTEST_EXTRA_FLAGS} --app-info-filepattern \"list_job_*.txt\" - - python tools/ci/artifacts_handler.py upload --type logs junit_reports pytest_examples_esp32h2_zigbee: extends: diff --git a/tools/ci/utils.sh b/tools/ci/utils.sh index d49f5bda5b..f860fef110 100644 --- a/tools/ci/utils.sh +++ b/tools/ci/utils.sh @@ -49,11 +49,6 @@ function set_component_ut_vars() { echo "exported variables COMPONENT_UT_DIRS, COMPONENT_UT_EXCLUDES" } -function upload_artifacts_to_s3() { - # for detailed documents, please refer to .gitlab/ci/README.md#uploaddownload-artifacts-to-internal-minio-server - python tools/ci/artifacts_handler.py upload -} - function error() { printf "\033[0;31m%s\n\033[0m" "${1}" >&2 }