ci: Add ccache with ninja generator for Windows builds

- Credits to @Artalus
This commit is contained in:
Plínio Larrubia 2024-09-16 21:44:47 -03:00
parent cf4824a008
commit 1d1c76277b
No known key found for this signature in database
GPG Key ID: 057B0A87CB137C69
2 changed files with 31 additions and 5 deletions

View File

@ -41,8 +41,21 @@ jobs:
restore-keys: | restore-keys: |
${{ env.cache-name }}- ${{ env.cache-name }}-
- name: Cache CMake dependency build objects
uses: hendrikmuhs/ccache-action@v1.2.14
env:
cache-name: ${{ runner.os }}-qt-cache-cmake-dependency-builds
with:
append-timestamp: false
key: ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
- name: Setup VS Environment
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: amd64
- name: Configure CMake - name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -T ClangCL -DENABLE_QT_GUI=ON run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_QT_GUI=ON -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build - name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
@ -50,8 +63,8 @@ jobs:
- name: Deploy - name: Deploy
run: | run: |
mkdir upload mkdir upload
move build/Release/shadPS4.exe upload move build/shadPS4.exe upload
windeployqt --dir upload upload/shadPS4.exe windeployqt --no-compiler-runtime --dir upload upload/shadPS4.exe
- name: Get date and git hash - name: Get date and git hash
id: vars id: vars

View File

@ -31,8 +31,21 @@ jobs:
restore-keys: | restore-keys: |
${{ env.cache-name }}- ${{ env.cache-name }}-
- name: Cache CMake dependency build objects
uses: hendrikmuhs/ccache-action@v1.2.14
env:
cache-name: ${{ runner.os }}-sdl-cache-cmake-dependency-builds
with:
append-timestamp: false
key: ${{ env.cache-name }}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
- name: Setup VS Environment
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: amd64
- name: Configure CMake - name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -T ClangCL run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build - name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel
@ -49,4 +62,4 @@ jobs:
with: with:
name: shadps4-win64-sdl-${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.shorthash }} name: shadps4-win64-sdl-${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.shorthash }}
path: | path: |
${{github.workspace}}/build/Release/shadPS4.exe ${{github.workspace}}/build/shadPS4.exe