1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:37:44 +00:00

CI: Update actions/cache to v3

This version now natively supports read-only caches (`cache/restore@v3`)
so we no longer need to pin the version to a commit in actions/cache#489
which is an unmerged PR.

The update is mostly mechanical:
- Steps with `CACHE_SKIP_SAVE` not set can use the plain `cache@v3`
  action.
- Steps with `CACHE_SKIP_SAVE` set to a constant `true` are changed to
  `cache/restore@v3`.
- Steps with saving disabled when running on a pull request are changed
  to a pair of `cache/restore@v3` and `cache/save@v3`. This setup is
  used for the large (100s of MB) ccache and Toolchain caches. As caches
  saved in pull requests can only be utilized from within the same PR,
  uploading these would only waste time and our storage quote.
  Therefore, we skip the `save` steps if running on a PR.

Co-authored-by: Cameron Youell <cameronyouell@gmail.com>
This commit is contained in:
Daniel Bertalan 2023-05-27 17:00:00 +02:00 committed by Andrew Kaster
parent c411b5408e
commit 18ee6e457d
6 changed files with 43 additions and 53 deletions

View file

@ -83,10 +83,8 @@ jobs:
message("::set-output name=libc_headers::${{ hashFiles('Userland/Libraries/LibC/**/*.h', 'Userland/Libraries/LibPthread/**/*.h', 'Toolchain/Patches/*.patch', 'Toolchain/Patches/gcc/*.patch', 'Toolchain/BuildIt.sh') }}") message("::set-output name=libc_headers::${{ hashFiles('Userland/Libraries/LibC/**/*.h', 'Userland/Libraries/LibPthread/**/*.h', 'Toolchain/Patches/*.patch', 'Toolchain/Patches/gcc/*.patch', 'Toolchain/BuildIt.sh') }}")
- name: Toolchain cache - name: Toolchain cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache/restore@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b id: toolchain-cache
env:
CACHE_SKIP_SAVE: ${{ github.event_name == 'pull_request' }}
with: with:
path: ${{ github.workspace }}/Toolchain/Cache/ path: ${{ github.workspace }}/Toolchain/Cache/
# This assumes that *ALL* LibC and LibPthread headers have an impact on the Toolchain. # This assumes that *ALL* LibC and LibPthread headers have an impact on the Toolchain.
@ -97,12 +95,19 @@ jobs:
- name: Restore or regenerate Toolchain - name: Restore or regenerate Toolchain
run: TRY_USE_LOCAL_TOOLCHAIN=y ARCH="${{ matrix.arch }}" ${{ github.workspace }}/Toolchain/BuildIt.sh run: TRY_USE_LOCAL_TOOLCHAIN=y ARCH="${{ matrix.arch }}" ${{ github.workspace }}/Toolchain/BuildIt.sh
- name: Update toolchain cache
uses: actions/cache/save@v3
# Do not waste time and storage space by updating the toolchain cache from a PR,
# as it would be discarded after being merged anyway.
if: ${{ github.event_name != 'pull_request' && !steps.toolchain-cache.outputs.cache-hit }}
with:
path: ${{ github.workspace }}/Toolchain/Cache/
key: ${{ steps.toolchain-cache.outputs.cache-primary-key }}
- name: ccache(1) cache - name: ccache(1) cache
# Pull the ccache *after* building the toolchain, in case building the Toolchain somehow interferes. # Pull the ccache *after* building the toolchain, in case building the Toolchain somehow interferes.
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache/restore@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b id: ccache
env:
CACHE_SKIP_SAVE: ${{ github.event_name == 'pull_request' }}
with: with:
path: ${{ github.workspace }}/.ccache path: ${{ github.workspace }}/.ccache
# If you're here because ccache broke (it never should), increment matrix.ccache-mark. # If you're here because ccache broke (it never should), increment matrix.ccache-mark.
@ -131,20 +136,17 @@ jobs:
mkdir -p ${{ github.workspace }}/Build/caches/UCD mkdir -p ${{ github.workspace }}/Build/caches/UCD
mkdir -p ${{ github.workspace }}/Build/caches/CLDR mkdir -p ${{ github.workspace }}/Build/caches/CLDR
- name: TimeZoneData cache - name: TimeZoneData cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/Build/caches/TZDB path: ${{ github.workspace }}/Build/caches/TZDB
key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }} key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }}
- name: UnicodeData cache - name: UnicodeData cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/Build/caches/UCD path: ${{ github.workspace }}/Build/caches/UCD
key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }} key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }}
- name: UnicodeLocale Cache - name: UnicodeLocale Cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/Build/caches/CLDR path: ${{ github.workspace }}/Build/caches/CLDR
key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }} key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }}
@ -185,6 +187,14 @@ jobs:
run: cmake --build . run: cmake --build .
- name: Show ccache stats after build - name: Show ccache stats after build
run: ccache -s run: ccache -s
- name: Update ccache(1) cache
uses: actions/cache/save@v3
if: ${{ github.event_name != 'pull_request' }}
with:
path: ${{ github.workspace }}/.ccache
key: ${{ steps.ccache.outputs.cache-primary-key }}
- name: Lint (Phase 2/2) - name: Lint (Phase 2/2)
working-directory: ${{ github.workspace }}/Meta working-directory: ${{ github.workspace }}/Meta
env: env:

View file

@ -77,22 +77,19 @@ jobs:
mkdir -p libjs-test262/Build/CLDR mkdir -p libjs-test262/Build/CLDR
- name: TimeZoneData cache - name: TimeZoneData cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/libjs-test262/Build/TZDB path: ${{ github.workspace }}/libjs-test262/Build/TZDB
key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }} key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }}
- name: UnicodeData cache - name: UnicodeData cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/libjs-test262/Build/UCD path: ${{ github.workspace }}/libjs-test262/Build/UCD
key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }} key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }}
- name: UnicodeLocale cache - name: UnicodeLocale cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/libjs-test262/Build/CLDR path: ${{ github.workspace }}/libjs-test262/Build/CLDR
key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }} key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }}

View file

@ -46,12 +46,8 @@ jobs:
message("::set-output name=libc_headers::${{ hashFiles('Userland/Libraries/LibC/**/*.h', 'Userland/Libraries/LibPthread/**/*.h', 'Toolchain/Patches/*.patch', 'Toolchain/Patches/gcc/*.patch', 'Toolchain/BuildIt.sh') }}") message("::set-output name=libc_headers::${{ hashFiles('Userland/Libraries/LibC/**/*.h', 'Userland/Libraries/LibPthread/**/*.h', 'Toolchain/Patches/*.patch', 'Toolchain/Patches/gcc/*.patch', 'Toolchain/BuildIt.sh') }}")
- name: Toolchain cache - name: Toolchain cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged.
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
env:
# This job should always read the cache, never populate it. # This job should always read the cache, never populate it.
CACHE_SKIP_SAVE: true uses: actions/cache/restore@v3
with: with:
path: ${{ github.workspace }}/Toolchain/Cache/ path: ${{ github.workspace }}/Toolchain/Cache/
# This assumes that *ALL* LibC and LibPthread headers have an impact on the Toolchain. # This assumes that *ALL* LibC and LibPthread headers have an impact on the Toolchain.
@ -70,20 +66,17 @@ jobs:
mkdir -p ${{ github.workspace }}/Build/caches/CLDR mkdir -p ${{ github.workspace }}/Build/caches/CLDR
- name: TimeZoneData cache - name: TimeZoneData cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/Build/caches/TZDB path: ${{ github.workspace }}/Build/caches/TZDB
key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }} key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }}
- name: UnicodeData cache - name: UnicodeData cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/Build/caches/UCD path: ${{ github.workspace }}/Build/caches/UCD
key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }} key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }}
- name: UnicodeLocale Cache - name: UnicodeLocale Cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/Build/caches/CLDR path: ${{ github.workspace }}/Build/caches/CLDR
key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }} key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }}

View file

@ -60,22 +60,19 @@ jobs:
mkdir -p Build/CLDR mkdir -p Build/CLDR
- name: TimeZoneData cache - name: TimeZoneData cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/libjs-test262/Build/TZDB path: ${{ github.workspace }}/libjs-test262/Build/TZDB
key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }} key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }}
- name: UnicodeData cache - name: UnicodeData cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/libjs-test262/Build/UCD path: ${{ github.workspace }}/libjs-test262/Build/UCD
key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }} key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }}
- name: UnicodeLocale cache - name: UnicodeLocale cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/libjs-test262/Build/CLDR path: ${{ github.workspace }}/libjs-test262/Build/CLDR
key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }} key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }}

View file

@ -78,12 +78,8 @@ jobs:
message("::set-output name=libc_headers::${{ hashFiles('Userland/Libraries/LibC/**/*.h', 'Userland/Libraries/LibPthread/**/*.h', 'Toolchain/Patches/*.patch', 'Toolchain/Patches/gcc/*.patch', 'Toolchain/BuildIt.sh') }}") message("::set-output name=libc_headers::${{ hashFiles('Userland/Libraries/LibC/**/*.h', 'Userland/Libraries/LibPthread/**/*.h', 'Toolchain/Patches/*.patch', 'Toolchain/Patches/gcc/*.patch', 'Toolchain/BuildIt.sh') }}")
- name: Toolchain cache - name: Toolchain cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged.
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
env:
# This job should always read the cache, never populate it. # This job should always read the cache, never populate it.
CACHE_SKIP_SAVE: true uses: actions/cache/restore@v3
with: with:
path: ${{ github.workspace }}/Toolchain/Cache/ path: ${{ github.workspace }}/Toolchain/Cache/
# This assumes that *ALL* LibC and LibPthread headers have an impact on the Toolchain. # This assumes that *ALL* LibC and LibPthread headers have an impact on the Toolchain.
@ -102,20 +98,17 @@ jobs:
mkdir -p ${{ github.workspace }}/Build/caches/CLDR mkdir -p ${{ github.workspace }}/Build/caches/CLDR
- name: TimeZoneData cache - name: TimeZoneData cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/Build/caches/TZDB path: ${{ github.workspace }}/Build/caches/TZDB
key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }} key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }}
- name: UnicodeData cache - name: UnicodeData cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/Build/caches/UCD path: ${{ github.workspace }}/Build/caches/UCD
key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }} key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }}
- name: UnicodeLocale Cache - name: UnicodeLocale Cache
# TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. uses: actions/cache@v3
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
with: with:
path: ${{ github.workspace }}/Build/caches/CLDR path: ${{ github.workspace }}/Build/caches/CLDR
key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }} key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }}

View file

@ -37,17 +37,17 @@ jobs:
mkdir -p ${{ github.workspace }}/Build/caches/UCD mkdir -p ${{ github.workspace }}/Build/caches/UCD
mkdir -p ${{ github.workspace }}/Build/caches/CLDR mkdir -p ${{ github.workspace }}/Build/caches/CLDR
- name: "TimeZoneData cache" - name: "TimeZoneData cache"
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b uses: actions/cache@v3
with: with:
path: ${{ github.workspace }}/Build/caches/TZDB path: ${{ github.workspace }}/Build/caches/TZDB
key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }} key: TimeZoneData-${{ hashFiles('Meta/CMake/time_zone_data.cmake') }}
- name: "UnicodeData cache" - name: "UnicodeData cache"
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b uses: actions/cache@v3
with: with:
path: ${{ github.workspace }}/Build/caches/UCD path: ${{ github.workspace }}/Build/caches/UCD
key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }} key: UnicodeData-${{ hashFiles('Meta/CMake/unicode_data.cmake') }}
- name: "UnicodeLocale cache" - name: "UnicodeLocale cache"
uses: actions/cache@03e00da99d75a2204924908e1cca7902cafce66b uses: actions/cache@v3
with: with:
path: ${{ github.workspace }}/Build/caches/CLDR path: ${{ github.workspace }}/Build/caches/CLDR
key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }} key: UnicodeLocale-${{ hashFiles('Meta/CMake/locale_data.cmake') }}