mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-03 14:50:02 +00:00
CI: Enable compiler cache for Windows
This commit is contained in:
parent
e4b2e7b131
commit
da2969008b
Notes:
github-actions[bot]
2025-08-04 20:07:14 +00:00
Author: https://github.com/ayeteadoe
Commit: da2969008b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5696
Reviewed-by: https://github.com/gmta ✅
3 changed files with 32 additions and 9 deletions
27
.github/actions/cache-restore/action.yml
vendored
27
.github/actions/cache-restore/action.yml
vendored
|
@ -67,16 +67,35 @@ runs:
|
|||
"ccache" | "${{ inputs.os }}" | "${{ inputs.arch }}" | "${{ inputs.toolchain }}" | "${{ inputs.cache_key_extra }}" | "${{ inputs.ccache_version }}"
|
||||
|
||||
- name: 'Configure Compiler Cache'
|
||||
if: ${{ inputs.ccache_path != '' }}
|
||||
if: ${{ inputs.os != 'Windows' && inputs.ccache_path != '' }}
|
||||
shell: bash
|
||||
env:
|
||||
CCACHE_DIR: ${{ inputs.ccache_path }}
|
||||
run: |
|
||||
CCACHE_DIR=${{ inputs.ccache_path }} ccache -M 0
|
||||
ccache -M 0
|
||||
|
||||
# Reset all ccache modification dates to a known epoch. This provides a baseline that we can prune against.
|
||||
find ${{ inputs.ccache_path }} | tac | xargs touch -a -m -d "2018-10-10T09:53:07Z"
|
||||
|
||||
CCACHE_DIR=${{ inputs.ccache_path }} ccache -s
|
||||
CCACHE_DIR=${{ inputs.ccache_path }} ccache -z
|
||||
ccache -s
|
||||
ccache -z
|
||||
|
||||
- name: 'Configure Compiler Cache (Windows)'
|
||||
if: ${{ inputs.os == 'Windows' && inputs.ccache_path != '' }}
|
||||
shell: pwsh
|
||||
env:
|
||||
CCACHE_DIR: ${{ inputs.ccache_path }}
|
||||
run: |
|
||||
ccache -M 0
|
||||
|
||||
# Reset all ccache modification dates to a known epoch. This provides a baseline that we can prune against.
|
||||
Get-ChildItem -Path "${{ inputs.ccache_path }}" -Recurse | Sort-Object FullName -Descending | ForEach-Object {
|
||||
$_.LastWriteTime = [DateTime]::Parse("2018-10-10T09:53:07Z")
|
||||
$_.LastAccessTime = [DateTime]::Parse("2018-10-10T09:53:07Z")
|
||||
}
|
||||
|
||||
ccache -s
|
||||
ccache -z
|
||||
|
||||
- name: 'Restore vcpkg cache'
|
||||
uses: actions/cache/restore@v4
|
||||
|
|
8
.github/actions/cache-save/action.yml
vendored
8
.github/actions/cache-save/action.yml
vendored
|
@ -32,9 +32,11 @@ runs:
|
|||
steps:
|
||||
- name: 'Prune obsolete ccache files'
|
||||
shell: bash
|
||||
env:
|
||||
CCACHE_DIR: ${{ inputs.ccache_path }}
|
||||
if: ${{ inputs.ccache_path != '' }}
|
||||
run: |
|
||||
CCACHE_DIR=${{ inputs.ccache_path }} ccache --evict-older-than=1d
|
||||
ccache --evict-older-than=1d
|
||||
|
||||
- name: 'Compiler Cache'
|
||||
uses: actions/cache/save@v4
|
||||
|
@ -45,9 +47,11 @@ runs:
|
|||
|
||||
- name: 'Cache Stats'
|
||||
shell: bash
|
||||
env:
|
||||
CCACHE_DIR: ${{ inputs.ccache_path }}
|
||||
if: ${{ inputs.ccache_path != '' }}
|
||||
run: |
|
||||
CCACHE_DIR=${{ inputs.ccache_path }} ccache -s
|
||||
ccache -s
|
||||
|
||||
- name: 'vcpkg binary cache'
|
||||
uses: actions/cache/save@v4
|
||||
|
|
4
.github/workflows/lagom-template.yml
vendored
4
.github/workflows/lagom-template.yml
vendored
|
@ -109,7 +109,7 @@ jobs:
|
|||
arch: ${{ inputs.arch }}
|
||||
toolchain: ${{ inputs.toolchain }}
|
||||
cache_key_extra: ${{ inputs.os_name == 'Windows' && inputs.build_preset || steps.build-parameters.outputs.ccache_key }}
|
||||
ccache_path: ${{ inputs.os_name != 'Windows' && env.CCACHE_DIR }}
|
||||
ccache_path: ${{ env.CCACHE_DIR }}
|
||||
download_cache_path: ${{ github.workspace }}/Build/caches
|
||||
vcpkg_cache_path: ${{ github.workspace }}/Build/caches/vcpkg-binary-cache
|
||||
|
||||
|
@ -189,7 +189,7 @@ jobs:
|
|||
with:
|
||||
runner_labels: ${{ inputs.runner_labels }}
|
||||
arch: ${{ inputs.arch }}
|
||||
ccache_path: ${{ inputs.os_name != 'Windows' && env.CCACHE_DIR }}
|
||||
ccache_path: ${{ env.CCACHE_DIR }}
|
||||
ccache_primary_key: ${{ steps.cache-restore.outputs.ccache_primary_key }}
|
||||
vcpkg_cache_path: ${{ github.workspace }}/Build/caches/vcpkg-binary-cache
|
||||
vcpkg_cache_primary_key: ${{ steps.cache-restore.outputs.vcpkg_cache_primary_key }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue