forked from qt-creator/qt-creator
GitHub Actions: Increase number of artifacts to search after cache
By default it's 30 per page and one page. Increasing to 100 per page and trying out 10 pages should provide recent results. Change-Id: I46d8e20a35f94d2ef81cc0bbead4bade66a17f5a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
46
.github/workflows/build_cmake.yml
vendored
46
.github/workflows/build_cmake.yml
vendored
@@ -375,32 +375,36 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
file(WRITE $ENV{GITHUB_WORKSPACE}/netrc.txt
|
file(WRITE $ENV{GITHUB_WORKSPACE}/netrc.txt
|
||||||
"default login runneradmin password ${{ secrets.GITHUB_TOKEN }}")
|
"default login runneradmin password ${{ secrets.GITHUB_TOKEN }}")
|
||||||
file(
|
|
||||||
DOWNLOAD "https://api.github.com/repos/${{ github.repository }}/actions/artifacts"
|
|
||||||
HTTPHEADER "Accept: application/vnd.github.v3+json"
|
|
||||||
NETRC_FILE "$ENV{GITHUB_WORKSPACE}/netrc.txt"
|
|
||||||
NETRC REQUIRED
|
|
||||||
SHOW_PROGRESS
|
|
||||||
artifacts.json)
|
|
||||||
file(READ artifacts.json artifacts_json)
|
|
||||||
|
|
||||||
string(JSON artifacts_length LENGTH "${artifacts_json}" "artifacts")
|
foreach(page_id RANGE 1 10)
|
||||||
math(EXPR artifacts_length "${artifacts_length} - 1")
|
file(
|
||||||
foreach(idx RANGE 0 ${artifacts_length})
|
DOWNLOAD "https://api.github.com/repos/${{ github.repository }}/actions/artifacts?per_page=100&page=${page_id}"
|
||||||
string(JSON artifact_js GET "${artifacts_json}" "artifacts" ${idx})
|
HTTPHEADER "Accept: application/vnd.github.v3+json"
|
||||||
string(JSON name GET "${artifact_js}" "name")
|
NETRC_FILE "$ENV{GITHUB_WORKSPACE}/netrc.txt"
|
||||||
if ("${name}" STREQUAL "${{ steps.ccache.outputs.archive_name }}")
|
NETRC REQUIRED
|
||||||
string(JSON download_url GET "${artifact_js}" "archive_download_url")
|
SHOW_PROGRESS
|
||||||
file(DOWNLOAD "${download_url}"
|
artifacts.json)
|
||||||
|
file(READ artifacts.json artifacts_json)
|
||||||
|
|
||||||
|
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")
|
||||||
|
file(DOWNLOAD "${download_url}"
|
||||||
"${{ steps.ccache.outputs.archive_name }}.zip"
|
"${{ steps.ccache.outputs.archive_name }}.zip"
|
||||||
NETRC_FILE "$ENV{GITHUB_WORKSPACE}/netrc.txt"
|
NETRC_FILE "$ENV{GITHUB_WORKSPACE}/netrc.txt"
|
||||||
NETRC REQUIRED
|
NETRC REQUIRED
|
||||||
SHOW_PROGRESS)
|
SHOW_PROGRESS)
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf "${{ steps.ccache.outputs.archive_name }}.zip")
|
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf "${{ steps.ccache.outputs.archive_name }}.zip")
|
||||||
file(MAKE_DIRECTORY .ccache)
|
file(MAKE_DIRECTORY .ccache)
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "../${{ steps.ccache.outputs.archive_name }}.tar" WORKING_DIRECTORY .ccache)
|
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "../${{ steps.ccache.outputs.archive_name }}.tar" WORKING_DIRECTORY .ccache)
|
||||||
break()
|
|
||||||
endif()
|
return()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
- name: Install system libs
|
- name: Install system libs
|
||||||
|
Reference in New Issue
Block a user