[PR #622] [MERGED] ci: enable cmake cache on all platforms (SDL/Qt) #1672

Closed
opened 2026-02-27 21:13:31 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/622
Author: @LeDragoX
Created: 8/27/2024
Status: Merged
Merged: 9/6/2024
Merged by: @psucien

Base: mainHead: cache-actions


📝 Commits (1)

  • 22d7024 ci: enable cmake cache on all platforms (SDL/Qt)

📊 Changes

6 files changed (+107 additions, -5 deletions)

View changed files

📝 .github/workflows/linux-qt.yml (+21 -2)
📝 .github/workflows/linux.yml (+20 -1)
📝 .github/workflows/macos-qt.yml (+22 -1)
📝 .github/workflows/macos.yml (+22 -1)
📝 .github/workflows/windows-qt.yml (+11 -0)
📝 .github/workflows/windows.yml (+11 -0)

📄 Description

This PR aims to improve build times in CI, Linux and macOS building steps have improved by a LOT!
Unfortunately, Windows still can't cache, even using sccache with MSVC.

  • Partially solves (#542)

Changes:

  • uses actions/cache@v4 and hendrikmuhs/ccache-action@v1.2.14
  • Keeps the cache from CMake Cache configuration (Windows, Linux, macOS).
  • Keeps the cache from CMake build objects (Linux/macOS).
  • Linux is using ccache from hendrikmuhs/ccache-action@v1.2.14.
  • macOS is using sccache from hendrikmuhs/ccache-action@v1.2.14.
  • Windows is caching the CMake Configuration step only, I've tried most stuff to force the use of caching, but without success, if anyone is willing to try, I've written some instructions below. I'm done with it.

Known Issues:

  • Using same cache name/hash for each OS will create new bugs like macOS-sdl trying to build with Qt. (Fixed)
  • The first CI run is not cached, the first time is when the cache is stored in here.
  • There is a limit for how many cache GitHub actions can store, see here.
  • Using CCache with Windows didn't work as expected, but did not broke the actions.
    • The only way that may work (needs testing and time) is by using MSYS2 MINGW64 and installing the packages:
    • mingw-w64-x86_64-ccache or mingw-w64-x86_64-sccache
    • It's worth noticing that MSYS2-compiled versions will only work under the MSYS2 shell, on native Windows will crash, even if you've copied the DLLs. (see action here)
  • Using CCache with macOS will break the actions. Fixed by using sccache instead.

There are some regression for some tests, but the most results are beneficial to CI building time.
Update: the regressions for Windows and macOS were fixed, and brings about a minute less of compile time.

Comparisons:

Before Caching After Caching
Linux firefox_2NvYAWlE2N 10m 13s firefox_M6CKQAD16m 2m 10s
Linux-Qt firefox_QmHnVkSlaQ 11m 27s firefox_4HC8x1XkWl 3m 5s
macOS firefox_0Zl7SOm1Uu 5m 39s Captura de tela 2024-09-01 175335 2m 58s
macOS-Qt firefox_v43iL0Odi9 6m 54s Captura de tela 2024-09-01 175403 4m 8s
Windows firefox_b615qmUwBJ 17m 50s firefox_7Zdfq2vBa0 14m 39s
Windows-Qt firefox_DRsdumDujr 18m 15s firefox_ugdmtlIfuw 20m 11s (Fixed)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/622 **Author:** [@LeDragoX](https://github.com/LeDragoX) **Created:** 8/27/2024 **Status:** ✅ Merged **Merged:** 9/6/2024 **Merged by:** [@psucien](https://github.com/psucien) **Base:** `main` ← **Head:** `cache-actions` --- ### 📝 Commits (1) - [`22d7024`](https://github.com/shadps4-emu/shadPS4/commit/22d7024fcb135a1225505e137cab21a0dbe139a7) ci: enable cmake cache on all platforms (SDL/Qt) ### 📊 Changes **6 files changed** (+107 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/linux-qt.yml` (+21 -2) 📝 `.github/workflows/linux.yml` (+20 -1) 📝 `.github/workflows/macos-qt.yml` (+22 -1) 📝 `.github/workflows/macos.yml` (+22 -1) 📝 `.github/workflows/windows-qt.yml` (+11 -0) 📝 `.github/workflows/windows.yml` (+11 -0) </details> ### 📄 Description This PR aims to improve build times in CI, Linux and macOS building steps have improved by a LOT! Unfortunately, Windows still can't cache, even using sccache with MSVC. - Partially solves (#542) ## Changes: - [x] uses [actions/cache@v4](https://github.com/actions/cache) and [hendrikmuhs/ccache-action@v1.2.14](https://github.com/hendrikmuhs/ccache-action) - [x] Keeps the cache from CMake Cache configuration (Windows, Linux, macOS). - [x] Keeps the cache from CMake build objects (Linux/macOS). - [x] Linux is using **ccache** from hendrikmuhs/ccache-action@v1.2.14. - [x] macOS is using **sccache** from hendrikmuhs/ccache-action@v1.2.14. - [x] Windows is caching the **CMake Configuration** step only, I've tried most stuff to force the use of caching, but without success, if anyone is willing to try, I've written some instructions below. ~I'm done with it~. ## Known Issues: - ~Using same cache name/hash for each OS will create new bugs like macOS-sdl trying to build with Qt.~ (Fixed) - The first CI run is not cached, the first time is when the cache is stored in [here](https://github.com/shadps4-emu/shadPS4/actions/caches). - There is a limit for how many cache GitHub actions can store, see [here](https://github.com/actions/cache?tab=readme-ov-file#cache-limits). - Using CCache with Windows didn't work as expected, but did not broke the actions. - The only way that _may_ work (needs testing and time) is by using MSYS2 MINGW64 and installing the packages: - `mingw-w64-x86_64-ccache` or `mingw-w64-x86_64-sccache` - It's worth noticing that MSYS2-compiled versions will only work under the MSYS2 shell, on native Windows will crash, even if you've copied the DLLs. (see action [here](https://github.com/LeDragoX/shadPS4/actions?query=branch%3Amsys2-ci)) - ~Using CCache with macOS will break the actions.~ Fixed by using sccache instead. ~There are some regression for some tests, but the most results are beneficial to CI building time.~ **Update:** the regressions for Windows and macOS were fixed, and brings about a minute less of compile time. Comparisons: | | Before Caching | After Caching | | :--------------: | :--------------: | :--------------: | | Linux | ![firefox_2NvYAWlE2N](https://github.com/user-attachments/assets/44d440d9-829f-414b-90ef-3d3e722f00c6) 10m 13s | ![firefox_M6CKQAD16m](https://github.com/user-attachments/assets/8c8d94ae-0408-4e09-a746-f5cbaf2793c9) 2m 10s | | Linux-Qt | ![firefox_QmHnVkSlaQ](https://github.com/user-attachments/assets/42f62af6-cd80-452e-815b-ca3cc999cba6) 11m 27s | ![firefox_4HC8x1XkWl](https://github.com/user-attachments/assets/3fe97b04-74dd-489d-920d-25f9b2e1da67) 3m 5s | | macOS | ![firefox_0Zl7SOm1Uu](https://github.com/user-attachments/assets/0a0ea353-3a2d-4e44-aa4c-23be93c03420) 5m 39s | ![Captura de tela 2024-09-01 175335](https://github.com/user-attachments/assets/1708a26b-117c-48ec-976e-fd85befac2ec) 2m 58s | | macOS-Qt | ![firefox_v43iL0Odi9](https://github.com/user-attachments/assets/e3bbcda1-fe98-4a75-a9bf-bcc3d2423fd6) 6m 54s | ![Captura de tela 2024-09-01 175403](https://github.com/user-attachments/assets/7f5522cc-826c-44ea-bf1e-9dc3d26472a4) 4m 8s | | Windows | ![firefox_b615qmUwBJ](https://github.com/user-attachments/assets/6139b6e4-992c-482d-b54c-07fea9ad42cd) 17m 50s | ![firefox_7Zdfq2vBa0](https://github.com/user-attachments/assets/20ff2045-074f-4f3b-b4d0-8bfb64fa8d10) 14m 39s | | Windows-Qt | ![firefox_DRsdumDujr](https://github.com/user-attachments/assets/643766df-dabe-432a-abd9-a10ced074773) 18m 15s | ![firefox_ugdmtlIfuw](https://github.com/user-attachments/assets/c30c1814-4ef4-464b-bb22-6c4fa52cc18e) 20m 11s (Fixed) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:13:31 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#1672
No description provided.