Skip to content

Commit

Permalink
Update ccache version to v4.9
Browse files Browse the repository at this point in the history
Also use upstream ccache since now it provides binaries for all
platforms.
  • Loading branch information
cristianadam committed Jan 3, 2024
1 parent bc505f7 commit aac246a
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
CMAKE_VERSION: 3.24.3
NINJA_VERSION: 1.11.1
BUILD_TYPE: Release
CCACHE_VERSION: 4.7.3
CCACHE_VERSION: 4.9

jobs:
build:
Expand Down Expand Up @@ -90,9 +90,32 @@ jobs:
id: ccache
shell: cmake -P {0}
run: |
set(ccache_url "https://github.com/cristianadam/ccache/releases/download/v$ENV{CCACHE_VERSION}/${{ runner.os }}.tar.xz")
file(DOWNLOAD "${ccache_url}" ./ccache.tar.xz SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ccache.tar.xz)
if ("${{ runner.os }}" STREQUAL "Windows")
set(ccache_dir "ccache-$ENV{CCACHE_VERSION}-windows-x86_64")
set(ccache_archive "${ccache_dir}.zip")
elseif ("${{ runner.os }}" STREQUAL "Linux")
set(ccache_dir "ccache-$ENV{CCACHE_VERSION}-linux-x86_64")
set(ccache_archive "${ccache_dir}.tar.xz")
elseif ("${{ runner.os }}" STREQUAL "macOS")
set(ccache_dir "ccache-$ENV{CCACHE_VERSION}-darwin")
set(ccache_archive "${ccache_dir}.tar.gz")
endif()
set(ccache_url "https://github.com/ccache/ccache/releases/download/v$ENV{CCACHE_VERSION}/${ccache_archive}")
file(DOWNLOAD "${ccache_url}" ./${ccache_archive} SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./${ccache_archive})
# Add to PATH environment variable
file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/${ccache_dir}" ccache_dir)
set(path_separator ":")
if ("${{ runner.os }}" STREQUAL "Windows")
set(path_separator ";")
endif()
file(APPEND "$ENV{GITHUB_PATH}" "$ENV{GITHUB_WORKSPACE}${path_separator}${ccache_dir}")
if (NOT "${{ runner.os }}" STREQUAL "Windows")
execute_process(COMMAND chmod +x ${ccache_dir}/ccache)
endif()
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
Expand Down

0 comments on commit aac246a

Please sign in to comment.