diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-07-24 08:20:42 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-07-24 08:28:43 +0200 |
commit | 2cf5ad9ea9b1c7edb77f5c3e42935d73d041f1f9 (patch) | |
tree | f6c812b11b82e74f0ed43cb7eacc28f91b3b73cd /.github/workflows/linux_builds.yml | |
parent | 422a2da8c7c2d973e391703ea0c0249b2c6fa4c5 (diff) |
CI: Fix cache key and include base branch
The base branch is hardcoded as an env variable as I couldn't find a simple
way to just get either `3.2` or `master`. But it's easy to change when we
branch off from `master` to a new stable branch, which doesn't happen often.
(There's `{{github.base_ref}}` but it's probably more verbose like
`ref/heads/master`, and only valid for PRs.)
Diffstat (limited to '.github/workflows/linux_builds.yml')
-rw-r--r-- | .github/workflows/linux_builds.yml | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index 1d2d5a3fa7..d91be544a3 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -3,6 +3,7 @@ on: [push, pull_request] # Global Cache Settings env: + GODOT_BASE_BRANCH: master SCONS_CACHE_LIMIT: 4096 jobs: @@ -26,18 +27,16 @@ jobs: libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm # Upload cache on completion and check it out now - # Editing this is pretty dangerous for windows since it can break and needs properly tested with a fresh cache. - # Linux with this will work reliably, so not as bad to edit for Linux. - name: Load .scons_cache directory id: linux-editor-cache uses: actions/cache@v2 with: path: ${{github.workspace}}/.scons_cache/ - key: ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} + key: ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}} restore-keys: | - ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} - ${{github.job}}-${GITHUB_REF##*/} - ${{github.job}} + ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}} + ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}} + ${{github.job}}-${{env.GODOT_BASE_BRANCH}} # Use python 3.x release (works cross platform; best to keep self contained in it's own step) - name: Set up Python 3.x @@ -83,18 +82,16 @@ jobs: libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm # Upload cache on completion and check it out now - # Editing this is pretty dangerous for windows since it can break and needs properly tested with a fresh cache. - # Linux with this will work reliably, so not as bad to edit for Linux. - name: Load .scons_cache directory id: linux-template-cache uses: actions/cache@v2 with: path: ${{github.workspace}}/.scons_cache/ - key: ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} + key: ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}} restore-keys: | - ${{github.job}}-${GITHUB_REF##*/}-${{github.sha}} - ${{github.job}}-${GITHUB_REF##*/} - ${{github.job}} + ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}} + ${{github.job}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}} + ${{github.job}}-${{env.GODOT_BASE_BRANCH}} # Use python 3.x release (works cross platform) - name: Set up Python 3.x @@ -112,6 +109,7 @@ jobs: python -m pip install scons python --version scons --version + - name: Compilation env: SCONS_CACHE: ${{github.workspace}}/.scons_cache/ |