add cmake checks caching
This commit is contained in:
@@ -34,8 +34,23 @@ jobs:
|
|||||||
run: >
|
run: >
|
||||||
sudo apt update && sudo apt install -y extra-cmake-modules libwayland-dev libxkbcommon-dev xorg-dev libarchive-dev libassimp-dev ninja-build glslang-tools glslang-dev unzip zip libcurl4-openssl-dev libfreetype-dev libjpeg-turbo8-dev nasm
|
sudo apt update && sudo apt install -y extra-cmake-modules libwayland-dev libxkbcommon-dev xorg-dev libarchive-dev libassimp-dev ninja-build glslang-tools glslang-dev unzip zip libcurl4-openssl-dev libfreetype-dev libjpeg-turbo8-dev nasm
|
||||||
&& sudo wget https://sourceforge.net/projects/bin2c/files/1.1/bin2c-1.1.zip && sudo unzip bin2c-1.1.zip && cd bin2c && sudo gcc -o bin2c bin2c.c && sudo mv bin2c /usr/bin
|
&& sudo wget https://sourceforge.net/projects/bin2c/files/1.1/bin2c-1.1.zip && sudo unzip bin2c-1.1.zip && cd bin2c && sudo gcc -o bin2c bin2c.c && sudo mv bin2c /usr/bin
|
||||||
|
|
||||||
|
- name: Get cmake checks from cache
|
||||||
|
uses: actions/cache/restore@v3
|
||||||
|
id: cache
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
${{github.workspace}}/build/cmake_checks_cache.txt
|
||||||
|
${{github.workspace}}/build/CMakeFiles/**/CMake*.cmake
|
||||||
|
key: ${{runner.os}}-cmakeChecks
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DDEPENDENCY_MIRROR_FILE="${{github.workspace}}/.gitea/workflows/DependencyMirrors.txt"
|
run: |
|
||||||
|
if [ "${{ steps.cache.outputs.cache-hit }}" != "true" ]; then
|
||||||
|
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DDEPENDENCY_MIRROR_FILE="${{github.workspace}}/.gitea/workflows/DependencyMirrors.txt"
|
||||||
|
else
|
||||||
|
cmake -B ${{github.workspace}}/build -C ${{github.workspace}}/build/cmake_checks_cache.txt -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DDEPENDENCY_MIRROR_FILE="${{github.workspace}}/.gitea/workflows/DependencyMirrors.txt"
|
||||||
|
fi
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||||
- name: Test
|
- name: Test
|
||||||
@@ -66,6 +81,16 @@ jobs:
|
|||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
- name: Cache cmake checks
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
|
id: cache-cmake-checks
|
||||||
|
uses: actions/cache/save@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
${{github.workspace}}/build/cmake_checks_cache.txt
|
||||||
|
${{github.workspace}}/build/CMakeFiles/**/CMake*.cmake
|
||||||
|
key: ${{runner.os}}-cmakeChecks
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
1
3rdParty/CMakeLists.txt
vendored
1
3rdParty/CMakeLists.txt
vendored
@@ -32,6 +32,7 @@ add_subdirectory(boost)
|
|||||||
add_subdirectory(units)
|
add_subdirectory(units)
|
||||||
add_subdirectory(libjpeg-turbo)
|
add_subdirectory(libjpeg-turbo)
|
||||||
add_subdirectory(msdf)
|
add_subdirectory(msdf)
|
||||||
|
add_subdirectory(cmake-checks-cache)
|
||||||
if (NOT IOS AND ENABLE_CURL)
|
if (NOT IOS AND ENABLE_CURL)
|
||||||
add_subdirectory(curl)
|
add_subdirectory(curl)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
14
3rdParty/cmake-checks-cache/CMakeLists.txt
vendored
Normal file
14
3rdParty/cmake-checks-cache/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
include (FetchContent)
|
||||||
|
|
||||||
|
if(NOT DEFINED CMAKE_CHECKS_REPO)
|
||||||
|
set(CMAKE_CHECKS_REPO https://github.com/cristianadam/cmake-checks-cache.git)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
FetchContent_Declare(
|
||||||
|
cmake-checks-cache
|
||||||
|
GIT_REPOSITORY ${CMAKE_CHECKS_REPO}
|
||||||
|
GIT_TAG master
|
||||||
|
GIT_SHALLOW TRUE
|
||||||
|
)
|
||||||
|
|
||||||
|
FetchContent_MakeAvailable(cmake-checks-cache)
|
||||||
@@ -15,7 +15,9 @@ if(LINUX)
|
|||||||
find_package(ECM REQUIRED NO_MODULE)
|
find_package(ECM REQUIRED NO_MODULE)
|
||||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/functions")
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_BINARY_DIR}/_deps/cmake-checks-cache-src/CMakeChecksCache"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/functions")
|
||||||
|
|
||||||
include(VarsFromFile)
|
include(VarsFromFile)
|
||||||
include(SetCompilerSettings)
|
include(SetCompilerSettings)
|
||||||
|
|||||||
Reference in New Issue
Block a user