mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-31 14:48:17 +00:00
CI: Use GitHub's actions cache instead of Blacksmith's for now
We were seeing lower ccache hitrates using Blacksmith's cache, and after some investigation it turned out that actions running on our `master` branch were pulling the caches from PRs. Blacksmith is looking into this - for now revert to GitHub's cache until the issue is resolved.
This commit is contained in:
parent
e96338dd63
commit
573696b10f
Notes:
github-actions[bot]
2025-06-18 16:41:05 +00:00
Author: https://github.com/gmta
Commit: 573696b10f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5135
Reviewed-by: https://github.com/trflynn89 ✅
2 changed files with 8 additions and 64 deletions
52
.github/actions/cache-restore/action.yml
vendored
52
.github/actions/cache-restore/action.yml
vendored
|
@ -42,10 +42,10 @@ inputs:
|
||||||
outputs:
|
outputs:
|
||||||
ccache_primary_key:
|
ccache_primary_key:
|
||||||
description: 'Primary ccache key'
|
description: 'Primary ccache key'
|
||||||
value: ${{ steps.cache-outputs.outputs.ccache_primary_key }}
|
value: ${{ steps.ccache.outputs.cache-primary-key }}
|
||||||
vcpkg_cache_primary_key:
|
vcpkg_cache_primary_key:
|
||||||
description: 'Primary vcpkg binary cache key'
|
description: 'Primary vcpkg binary cache key'
|
||||||
value: ${{ steps.cache-outputs.outputs.vcpkg_cache_primary_key }}
|
value: ${{ steps.vcpkg.outputs.cache-primary-key }}
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
|
@ -56,26 +56,13 @@ runs:
|
||||||
run: |
|
run: |
|
||||||
echo "timestamp=$(date -u "+%Y%m%d%H%M_%S")" >> "$GITHUB_OUTPUT"
|
echo "timestamp=$(date -u "+%Y%m%d%H%M_%S")" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: 'Compiler Cache (blacksmith)'
|
- name: 'Compiler Cache'
|
||||||
uses: useblacksmith/cache/restore@v5
|
|
||||||
id: 'ccache-blacksmith'
|
|
||||||
if: ${{ inputs.ccache_path != '' && contains(inputs.runner_labels, 'blacksmith') }}
|
|
||||||
with:
|
|
||||||
path: ${{ inputs.ccache_path }}
|
|
||||||
key: '"ccache" | "${{ inputs.os }}" | "${{ inputs.arch }}" | "${{ inputs.toolchain }}" | "${{ inputs.cache_key_extra }}" | "${{ inputs.ccache_version }}" | ${{ steps.date-stamp.outputs.timestamp }}'
|
|
||||||
restore-keys: |
|
|
||||||
ccache | ${{ inputs.os }} | ${{ inputs.arch }} | ${{ inputs.toolchain }} | ${{ inputs.cache_key_extra }} | ${{ inputs.ccache_version }}
|
|
||||||
"ccache" | "${{ inputs.os }}" | "${{ inputs.arch }}" | "${{ inputs.toolchain }}" | "${{ inputs.cache_key_extra }}" | "${{ inputs.ccache_version }}"
|
|
||||||
|
|
||||||
- name: 'Compiler Cache (GitHub runner)'
|
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
id: 'ccache-gh'
|
id: 'ccache'
|
||||||
if: ${{ inputs.ccache_path != '' && !contains(inputs.runner_labels, 'blacksmith') }}
|
|
||||||
with:
|
with:
|
||||||
path: ${{ inputs.ccache_path }}
|
path: ${{ inputs.ccache_path }}
|
||||||
key: '"ccache" | "${{ inputs.os }}" | "${{ inputs.arch }}" | "${{ inputs.toolchain }}" | "${{ inputs.cache_key_extra }}" | "${{ inputs.ccache_version }}" | ${{ steps.date-stamp.outputs.timestamp }}'
|
key: '"ccache" | "${{ inputs.os }}" | "${{ inputs.arch }}" | "${{ inputs.toolchain }}" | "${{ inputs.cache_key_extra }}" | "${{ inputs.ccache_version }}" | ${{ steps.date-stamp.outputs.timestamp }}'
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
ccache | ${{ inputs.os }} | ${{ inputs.arch }} | ${{ inputs.toolchain }} | ${{ inputs.cache_key_extra }} | ${{ inputs.ccache_version }}
|
|
||||||
"ccache" | "${{ inputs.os }}" | "${{ inputs.arch }}" | "${{ inputs.toolchain }}" | "${{ inputs.cache_key_extra }}" | "${{ inputs.ccache_version }}"
|
"ccache" | "${{ inputs.os }}" | "${{ inputs.arch }}" | "${{ inputs.toolchain }}" | "${{ inputs.cache_key_extra }}" | "${{ inputs.ccache_version }}"
|
||||||
|
|
||||||
- name: 'Configure Compiler Cache'
|
- name: 'Configure Compiler Cache'
|
||||||
|
@ -90,38 +77,11 @@ runs:
|
||||||
CCACHE_DIR=${{ inputs.ccache_path }} ccache -s
|
CCACHE_DIR=${{ inputs.ccache_path }} ccache -s
|
||||||
CCACHE_DIR=${{ inputs.ccache_path }} ccache -z
|
CCACHE_DIR=${{ inputs.ccache_path }} ccache -z
|
||||||
|
|
||||||
- name: 'Restore vcpkg cache (blacksmith)'
|
- name: 'Restore vcpkg cache'
|
||||||
uses: useblacksmith/cache/restore@v5
|
|
||||||
if: ${{ inputs.vcpkg_cache_path != '' && contains(inputs.runner_labels, 'blacksmith') }}
|
|
||||||
id: 'vcpkg-blacksmith'
|
|
||||||
with:
|
|
||||||
path: ${{ inputs.vcpkg_cache_path }}
|
|
||||||
key: '"vcpkg" | "${{ inputs.os }}" | "${{ inputs.arch }}" | "${{ inputs.toolchain }}" | "${{ inputs.cache_key_extra }}" | "${{ inputs.ccache_version }}" | ${{ steps.date-stamp.outputs.timestamp }}'
|
|
||||||
restore-keys: |
|
|
||||||
vcpkg | ${{ inputs.os }} | ${{ inputs.arch }} | ${{ inputs.toolchain }} | ${{ inputs.cache_key_extra }} | ${{ inputs.ccache_version }}
|
|
||||||
"vcpkg" | "${{ inputs.os }}" | "${{ inputs.arch }}" | "${{ inputs.toolchain }}" | "${{ inputs.cache_key_extra }}" | "${{ inputs.ccache_version }}"
|
|
||||||
|
|
||||||
- name: 'Restore vcpkg cache (GitHub runner)'
|
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
if: ${{ inputs.ccache_path != '' && !contains(inputs.runner_labels, 'blacksmith') }}
|
id: 'vcpkg'
|
||||||
id: 'vcpkg-gh'
|
|
||||||
with:
|
with:
|
||||||
path: ${{ inputs.vcpkg_cache_path }}
|
path: ${{ inputs.vcpkg_cache_path }}
|
||||||
key: '"vcpkg" | "${{ inputs.os }}" | "${{ inputs.arch }}" | "${{ inputs.toolchain }}" | "${{ inputs.cache_key_extra }}" | "${{ inputs.ccache_version }}" | ${{ steps.date-stamp.outputs.timestamp }}'
|
key: '"vcpkg" | "${{ inputs.os }}" | "${{ inputs.arch }}" | "${{ inputs.toolchain }}" | "${{ inputs.cache_key_extra }}" | "${{ inputs.ccache_version }}" | ${{ steps.date-stamp.outputs.timestamp }}'
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
vcpkg | ${{ inputs.os }} | ${{ inputs.arch }} | ${{ inputs.toolchain }} | ${{ inputs.cache_key_extra }} | ${{ inputs.ccache_version }}
|
|
||||||
"vcpkg" | "${{ inputs.os }}" | "${{ inputs.arch }}" | "${{ inputs.toolchain }}" | "${{ inputs.cache_key_extra }}" | "${{ inputs.ccache_version }}"
|
"vcpkg" | "${{ inputs.os }}" | "${{ inputs.arch }}" | "${{ inputs.toolchain }}" | "${{ inputs.cache_key_extra }}" | "${{ inputs.ccache_version }}"
|
||||||
|
|
||||||
# FIXME: When all runners are using the useblacksmith/cache action and this step is removed, we should also be able
|
|
||||||
# to remove the quoteless cache restore keys in the cache actions above.
|
|
||||||
- name: 'Cache Outputs'
|
|
||||||
id: 'cache-outputs'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
if ${{ contains(inputs.runner_labels, 'blacksmith') }} ; then
|
|
||||||
echo "ccache_primary_key=${{ steps.ccache-blacksmith.outputs.cache-primary-key }}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "vcpkg_cache_primary_key=${{ steps.vcpkg-blacksmith.outputs.cache-primary-key }}" >> "$GITHUB_OUTPUT"
|
|
||||||
else
|
|
||||||
echo "ccache_primary_key=${{ steps.ccache-gh.outputs.cache-primary-key }}" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "vcpkg_cache_primary_key=${{ steps.vcpkg-gh.outputs.cache-primary-key }}" >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
|
||||||
|
|
20
.github/actions/cache-save/action.yml
vendored
20
.github/actions/cache-save/action.yml
vendored
|
@ -36,16 +36,8 @@ runs:
|
||||||
run: |
|
run: |
|
||||||
CCACHE_DIR=${{ inputs.ccache_path }} ccache --evict-older-than=1d
|
CCACHE_DIR=${{ inputs.ccache_path }} ccache --evict-older-than=1d
|
||||||
|
|
||||||
- name: 'Compiler Cache (blacksmith)'
|
- name: 'Compiler Cache'
|
||||||
uses: useblacksmith/cache/save@v5
|
|
||||||
if: ${{ inputs.ccache_path != '' && contains(inputs.runner_labels, 'blacksmith') }}
|
|
||||||
with:
|
|
||||||
path: ${{ inputs.ccache_path }}
|
|
||||||
key: ${{ inputs.ccache_primary_key }}
|
|
||||||
|
|
||||||
- name: 'Compiler Cache (GitHub runner)'
|
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
if: ${{ inputs.ccache_path != '' && !contains(inputs.runner_labels, 'blacksmith') }}
|
|
||||||
with:
|
with:
|
||||||
path: ${{ inputs.ccache_path }}
|
path: ${{ inputs.ccache_path }}
|
||||||
key: ${{ inputs.ccache_primary_key }}
|
key: ${{ inputs.ccache_primary_key }}
|
||||||
|
@ -56,16 +48,8 @@ runs:
|
||||||
run: |
|
run: |
|
||||||
CCACHE_DIR=${{ inputs.ccache_path }} ccache -s
|
CCACHE_DIR=${{ inputs.ccache_path }} ccache -s
|
||||||
|
|
||||||
- name: 'vcpkg binary cache (blacksmith)'
|
- name: 'vcpkg binary cache'
|
||||||
uses: useblacksmith/cache/save@v5
|
|
||||||
if: ${{ inputs.vcpkg_cache_path != '' && contains(inputs.runner_labels, 'blacksmith') }}
|
|
||||||
with:
|
|
||||||
path: ${{ inputs.vcpkg_cache_path }}
|
|
||||||
key: ${{ inputs.vcpkg_cache_primary_key }}
|
|
||||||
|
|
||||||
- name: 'vcpkg binary cache (GitHub runner)'
|
|
||||||
uses: actions/cache/save@v4
|
uses: actions/cache/save@v4
|
||||||
if: ${{ inputs.vcpkg_cache_path != '' && !contains(inputs.runner_labels, 'blacksmith') }}
|
|
||||||
with:
|
with:
|
||||||
path: ${{ inputs.vcpkg_cache_path }}
|
path: ${{ inputs.vcpkg_cache_path }}
|
||||||
key: ${{ inputs.vcpkg_cache_primary_key }}
|
key: ${{ inputs.vcpkg_cache_primary_key }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue