From 3c07d0ff325598027e4cd7b5204726cb585e056e Mon Sep 17 00:00:00 2001 From: Gordon MacPherson Date: Fri, 24 Jul 2020 00:14:03 +0100 Subject: [PATCH 1/2] Clamp scons cache to 4096 MB --- .github/workflows/android_builds.yml | 2 +- .github/workflows/javascript_builds.yml | 2 +- .github/workflows/linux_builds.yml | 2 +- .github/workflows/macos_builds.yml | 2 +- .github/workflows/windows_builds.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/android_builds.yml b/.github/workflows/android_builds.yml index 1b3071028a6..ebe91702de3 100644 --- a/.github/workflows/android_builds.yml +++ b/.github/workflows/android_builds.yml @@ -3,7 +3,7 @@ on: [push, pull_request] # Global Cache Settings env: - SCONS_CACHE_LIMIT: 8192 + SCONS_CACHE_LIMIT: 4096 jobs: android-template: diff --git a/.github/workflows/javascript_builds.yml b/.github/workflows/javascript_builds.yml index c25140979b4..19fa6c34fd5 100644 --- a/.github/workflows/javascript_builds.yml +++ b/.github/workflows/javascript_builds.yml @@ -3,7 +3,7 @@ on: [push, pull_request] # Global Cache Settings env: - SCONS_CACHE_LIMIT: 8192 + SCONS_CACHE_LIMIT: 4096 EM_VERSION: latest EM_CACHE_FOLDER: 'emsdk-cache' diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index 8806a567fae..6f6f4669f7a 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -3,7 +3,7 @@ on: [push, pull_request] # Global Cache Settings env: - SCONS_CACHE_LIMIT: 8192 + SCONS_CACHE_LIMIT: 4096 jobs: linux-editor: diff --git a/.github/workflows/macos_builds.yml b/.github/workflows/macos_builds.yml index 8624178e280..392a3da595b 100644 --- a/.github/workflows/macos_builds.yml +++ b/.github/workflows/macos_builds.yml @@ -3,7 +3,7 @@ on: [push, pull_request] # Global Cache Settings env: - SCONS_CACHE_LIMIT: 8192 + SCONS_CACHE_LIMIT: 4096 jobs: macos-editor: diff --git a/.github/workflows/windows_builds.yml b/.github/workflows/windows_builds.yml index 036f11526e3..0f707062ec1 100644 --- a/.github/workflows/windows_builds.yml +++ b/.github/workflows/windows_builds.yml @@ -5,7 +5,7 @@ on: [push, pull_request] # SCONS_CACHE for windows must be set in the build environment env: SCONS_CACHE_MSVC_CONFIG: true - SCONS_CACHE_LIMIT: 8192 + SCONS_CACHE_LIMIT: 4096 jobs: windows-editor: From afdce1e30c3ddf8e68d5dade28f81bd3a6c3e2ab Mon Sep 17 00:00:00 2001 From: Gordon MacPherson Date: Fri, 24 Jul 2020 00:15:23 +0100 Subject: [PATCH 2/2] Improve the cache keys to prevent clashes for the wrong type of build --- .github/workflows/android_builds.yml | 8 ++++---- .github/workflows/javascript_builds.yml | 5 +++-- .github/workflows/linux_builds.yml | 16 ++++++++-------- .github/workflows/macos_builds.yml | 16 ++++++++-------- .github/workflows/windows_builds.yml | 16 ++++++++-------- 5 files changed, 31 insertions(+), 30 deletions(-) diff --git a/.github/workflows/android_builds.yml b/.github/workflows/android_builds.yml index ebe91702de3..6fd2ce72393 100644 --- a/.github/workflows/android_builds.yml +++ b/.github/workflows/android_builds.yml @@ -43,11 +43,11 @@ jobs: uses: actions/cache@v2 with: path: ${{github.workspace}}/.scons_cache/ - key: ${{runner.os}}-template-${{github.sha}} + key: ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} restore-keys: | - ${{runner.os}}-template-${{github.sha}} - ${{runner.os}}-template - ${{runner.os}} + ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} + ${{github.job}}-${GITHUB_REF##*/} + ${{github.job}} # Use python 3.x release (works cross platform) - name: Set up Python 3.x diff --git a/.github/workflows/javascript_builds.yml b/.github/workflows/javascript_builds.yml index 19fa6c34fd5..5a72b96eb8e 100644 --- a/.github/workflows/javascript_builds.yml +++ b/.github/workflows/javascript_builds.yml @@ -29,9 +29,10 @@ jobs: uses: actions/cache@v2 with: path: ${{github.workspace}}/.scons_cache/ - key: ${{github.job}}-${{github.sha}} + key: ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} restore-keys: | - ${{github.job}}-${{github.sha}} + ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} + ${{github.job}}-${GITHUB_REF##*/} ${{github.job}} # Additional cache for Emscripten generated system libraries diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index 6f6f4669f7a..1d2d5a3fa7d 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -33,11 +33,11 @@ jobs: uses: actions/cache@v2 with: path: ${{github.workspace}}/.scons_cache/ - key: ${{runner.os}}-editor-${{github.sha}} + key: ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} restore-keys: | - ${{runner.os}}-editor-${{github.sha}} - ${{runner.os}}-editor - ${{runner.os}} + ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} + ${{github.job}}-${GITHUB_REF##*/} + ${{github.job}} # Use python 3.x release (works cross platform; best to keep self contained in it's own step) - name: Set up Python 3.x @@ -90,11 +90,11 @@ jobs: uses: actions/cache@v2 with: path: ${{github.workspace}}/.scons_cache/ - key: ${{runner.os}}-template-${{github.sha}} + key: ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} restore-keys: | - ${{runner.os}}-template-${{github.sha}} - ${{runner.os}}-template - ${{runner.os}} + ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} + ${{github.job}}-${GITHUB_REF##*/} + ${{github.job}} # Use python 3.x release (works cross platform) - name: Set up Python 3.x diff --git a/.github/workflows/macos_builds.yml b/.github/workflows/macos_builds.yml index 392a3da595b..b896732ffc5 100644 --- a/.github/workflows/macos_builds.yml +++ b/.github/workflows/macos_builds.yml @@ -22,11 +22,11 @@ jobs: uses: actions/cache@v2 with: path: ${{github.workspace}}/.scons_cache/ - key: ${{runner.os}}-editor-${{github.sha}} + key: ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} restore-keys: | - ${{runner.os}}-editor-${{github.sha}} - ${{runner.os}}-editor - ${{runner.os}} + ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} + ${{github.job}}-${GITHUB_REF##*/} + ${{github.job}} # Use python 3.x release (works cross platform; best to keep self contained in it's own step) - name: Set up Python 3.x @@ -67,11 +67,11 @@ jobs: uses: actions/cache@v2 with: path: ${{github.workspace}}/.scons_cache/ - key: ${{runner.os}}-template-${{github.sha}} + key: ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} restore-keys: | - ${{runner.os}}-template-${{github.sha}} - ${{runner.os}}-template - ${{runner.os}} + ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} + ${{github.job}}-${GITHUB_REF##*/} + ${{github.job}} # Use python 3.x release (works cross platform) - name: Set up Python 3.x diff --git a/.github/workflows/windows_builds.yml b/.github/workflows/windows_builds.yml index 0f707062ec1..611684debb6 100644 --- a/.github/workflows/windows_builds.yml +++ b/.github/workflows/windows_builds.yml @@ -26,11 +26,11 @@ jobs: uses: RevoluPowered/cache@v2.1 with: path: /.scons_cache/ - key: ${{runner.os}}-editor-${{github.sha}} + key: ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} restore-keys: | - ${{runner.os}}-editor-${{github.sha}} - ${{runner.os}}-editor - ${{runner.os}} + ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} + ${{github.job}}-${GITHUB_REF##*/} + ${{github.job}} # Use python 3.x release (works cross platform; best to keep self contained in it's own step) - name: Set up Python 3.x @@ -80,11 +80,11 @@ jobs: uses: RevoluPowered/cache@v2.1 with: path: /.scons_cache/ - key: ${{runner.os}}-template-${{github.sha}} + key: ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} restore-keys: | - ${{runner.os}}-template-${{github.sha}} - ${{runner.os}}-template - ${{runner.os}} + ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} + ${{github.job}}-${GITHUB_REF##*/} + ${{github.job}} # Use python 3.x release (works cross platform) - name: Set up Python 3.x