summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2023-01-20 10:52:31 +0100
committerEike Ziller <eike.ziller@qt.io>2023-02-07 08:00:08 +0000
commitc6853ff32a123a3fe4956d7667cf53b0138c19c1 (patch)
tree807fa7611b73dc4309afb0a22b56523a4b84012c /.github
parentdd3f5d3a6a6803b0ac6ce37d861ab27e0b25eb19 (diff)
downloadqt-creator-c6853ff32a123a3fe4956d7667cf53b0138c19c1.tar.gz
GitHub: Fix ccache archive downloading if there is none
Change-Id: I54fcac1a86c6f101469a695aa3610ae755354271 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build_cmake.yml52
1 files changed, 27 insertions, 25 deletions
diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml
index e430f35ebd..b93e14251d 100644
--- a/.github/workflows/build_cmake.yml
+++ b/.github/workflows/build_cmake.yml
@@ -458,31 +458,33 @@ jobs:
string(JSON artifacts_length LENGTH "${artifacts_json}" "artifacts")
math(EXPR artifacts_length "${artifacts_length} - 1")
- foreach(idx RANGE 0 ${artifacts_length})
- string(JSON artifact_js GET "${artifacts_json}" "artifacts" ${idx})
- string(JSON name GET "${artifact_js}" "name")
- if ("${name}" STREQUAL "${{ steps.ccache.outputs.archive_name }}")
- string(JSON download_url GET "${artifact_js}" "archive_download_url")
-
- foreach(retry RANGE 10)
- file(DOWNLOAD "${download_url}"
- "${{ steps.ccache.outputs.archive_name }}.zip"
- NETRC_FILE "$ENV{GITHUB_WORKSPACE}/netrc.txt"
- NETRC REQUIRED
- SHOW_PROGRESS)
- file(SIZE "${{ steps.ccache.outputs.archive_name }}.zip" fileSize)
- if (fileSize GREATER 0)
- break()
- endif()
- endforeach()
-
- execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf "${{ steps.ccache.outputs.archive_name }}.zip")
- file(MAKE_DIRECTORY .ccache)
- execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "../${{ steps.ccache.outputs.archive_name }}.tar" WORKING_DIRECTORY .ccache)
-
- return()
- endif()
- endforeach()
+ if(${artifacts_length} GREATER_EQUAL 0)
+ foreach(idx RANGE 0 ${artifacts_length})
+ string(JSON artifact_js GET "${artifacts_json}" "artifacts" ${idx})
+ string(JSON name GET "${artifact_js}" "name")
+ if ("${name}" STREQUAL "${{ steps.ccache.outputs.archive_name }}")
+ string(JSON download_url GET "${artifact_js}" "archive_download_url")
+
+ foreach(retry RANGE 10)
+ file(DOWNLOAD "${download_url}"
+ "${{ steps.ccache.outputs.archive_name }}.zip"
+ NETRC_FILE "$ENV{GITHUB_WORKSPACE}/netrc.txt"
+ NETRC REQUIRED
+ SHOW_PROGRESS)
+ file(SIZE "${{ steps.ccache.outputs.archive_name }}.zip" fileSize)
+ if (fileSize GREATER 0)
+ break()
+ endif()
+ endforeach()
+
+ execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf "${{ steps.ccache.outputs.archive_name }}.zip")
+ file(MAKE_DIRECTORY .ccache)
+ execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "../${{ steps.ccache.outputs.archive_name }}.tar" WORKING_DIRECTORY .ccache)
+
+ return()
+ endif()
+ endforeach()
+ endif()
endforeach()
- name: Build