add cmake checks caching
This commit is contained in:
@@ -34,8 +34,23 @@ jobs:
|
||||
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 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
|
||||
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
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
- name: Test
|
||||
@@ -66,6 +81,16 @@ jobs:
|
||||
if-no-files-found: error
|
||||
retention-days: 30
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user