mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-11-28 08:08:03 -08:00
ci: key Library caches per build configuration (#864)
Server and Player builds shared a cache key, and every job could fall back to any other job's Library through the bare Library- restore key. A Library remembers its last standalone subtarget, so a macOS Player build that restored an Ubuntu Server Library tried to build a Mac Dedicated Server and failed. Keys now include the scripting backend and subtarget, prefix fallbacks are gone, and the v2 prefix leaves the polluted caches behind. Co-authored-by: Frostebite <[email protected]>
This commit is contained in:
co-authored by
Frostebite
parent
58e7224b82
commit
fc892a0623
@@ -59,10 +59,11 @@ jobs:
|
|||||||
id: cache-restore
|
id: cache-restore
|
||||||
with:
|
with:
|
||||||
path: ${{ matrix.projectPath }}/Library
|
path: ${{ matrix.projectPath }}/Library
|
||||||
key: Library-${{ matrix.projectPath }}-macos-${{ matrix.targetPlatform }}-${{ matrix.unityVersion }}-${{ matrix.buildProfile }}
|
# One cache per build configuration and no prefix fallback: a Library
|
||||||
restore-keys: |
|
# remembers the settings of the build that produced it (such as the
|
||||||
Library-${{ matrix.projectPath }}-macos-
|
# standalone subtarget), so restoring another configuration's Library
|
||||||
Library-
|
# changes what gets built. Bump the version to discard every Library cache.
|
||||||
|
key: Library-v2-${{ matrix.projectPath }}-macos-${{ matrix.targetPlatform }}-${{ matrix.unityVersion }}-il2cpp-true-subtarget-player-${{ matrix.buildProfile }}
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
# Set Scripting Backend #
|
# Set Scripting Backend #
|
||||||
|
|||||||
@@ -138,10 +138,11 @@ jobs:
|
|||||||
id: cache-restore
|
id: cache-restore
|
||||||
with:
|
with:
|
||||||
path: ${{ matrix.projectPath }}/Library
|
path: ${{ matrix.projectPath }}/Library
|
||||||
key: Library-${{ matrix.projectPath }}-ubuntu-${{ matrix.targetPlatform }}-${{ matrix.unityVersion }}-${{ matrix.buildProfile }}
|
# One cache per build configuration and no prefix fallback: a Library
|
||||||
restore-keys: |
|
# remembers the settings of the build that produced it (such as the
|
||||||
Library-${{ matrix.projectPath }}-ubuntu-
|
# standalone subtarget), so restoring another configuration's Library
|
||||||
Library-
|
# changes what gets built. Bump the version to discard every Library cache.
|
||||||
|
key: Library-v2-${{ matrix.projectPath }}-ubuntu-${{ matrix.targetPlatform }}-${{ matrix.unityVersion }}-il2cpp-${{ matrix.buildWithIl2cpp == true }}-subtarget-${{ contains(matrix.additionalParameters, '-standaloneBuildSubtarget Server') && 'server' || 'player' }}-${{ matrix.buildProfile }}
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
# Set Scripting Backend #
|
# Set Scripting Backend #
|
||||||
|
|||||||
@@ -66,10 +66,11 @@ jobs:
|
|||||||
id: cache-restore
|
id: cache-restore
|
||||||
with:
|
with:
|
||||||
path: ${{ matrix.projectPath }}/Library
|
path: ${{ matrix.projectPath }}/Library
|
||||||
key: Library-${{ matrix.projectPath }}-windows-${{ matrix.targetPlatform }}-${{ matrix.unityVersion }}-${{ matrix.buildProfile }}
|
# One cache per build configuration and no prefix fallback: a Library
|
||||||
restore-keys: |
|
# remembers the settings of the build that produced it (such as the
|
||||||
Library-${{ matrix.projectPath }}-windows-
|
# standalone subtarget), so restoring another configuration's Library
|
||||||
Library-
|
# changes what gets built. Bump the version to discard every Library cache.
|
||||||
|
key: Library-v2-${{ matrix.projectPath }}-windows-${{ matrix.targetPlatform }}-${{ matrix.unityVersion }}-il2cpp-true-subtarget-player-${{ matrix.buildProfile }}
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
# Set Scripting Backend #
|
# Set Scripting Backend #
|
||||||
|
|||||||
Reference in New Issue
Block a user