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.)
This commit is contained in:
Rémi Verschelde 2020-07-24 08:20:42 +02:00
parent 422a2da8c7
commit 2cf5ad9ea9
5 changed files with 48 additions and 53 deletions

View File

@ -3,13 +3,14 @@ on: [push, pull_request]
# Global Cache Settings
env:
GODOT_BASE_BRANCH: master
SCONS_CACHE_LIMIT: 4096
jobs:
android-template:
runs-on: "ubuntu-20.04"
name: Android Template (target=release, tools=no)
name: Template (target=release, tools=no)
steps:
- uses: actions/checkout@v2
@ -20,13 +21,13 @@ jobs:
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
sudo apt-get update
# install all packages (except scons)
# Install all packages (except scons)
- name: Configure dependencies
run: |
sudo apt-get install openjdk-8-jdk
echo "::set-env name=JAVA_HOME::usr/lib/jvm/java-8-openjdk-amd64"
- name: Install Android Sdk and Ndk
- name: Install Android SDK and NDK
run: |
echo "::set-env name=PATH::/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:${PATH}"
java -version
@ -36,20 +37,18 @@ jobs:
source ~/.bashrc
# 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: android-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)
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
@ -65,6 +64,7 @@ jobs:
python -m pip install scons
python --version
scons --version
- name: Compilation
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/

View File

@ -3,6 +3,7 @@ on: [push, pull_request]
# Global Cache Settings
env:
GODOT_BASE_BRANCH: master
SCONS_CACHE_LIMIT: 4096
EM_VERSION: latest
EM_CACHE_FOLDER: 'emsdk-cache'
@ -22,18 +23,16 @@ jobs:
sudo apt-get update
# 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: javascript-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}}
# Additional cache for Emscripten generated system libraries
- name: Load Emscripten cache

View File

@ -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/

View File

@ -3,6 +3,7 @@ on: [push, pull_request]
# Global Cache Settings
env:
GODOT_BASE_BRANCH: master
SCONS_CACHE_LIMIT: 4096
jobs:
@ -15,18 +16,16 @@ jobs:
- uses: actions/checkout@v2
# 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: macos-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
@ -60,18 +59,16 @@ jobs:
- uses: actions/checkout@v2
# 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: macos-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
@ -89,6 +86,7 @@ jobs:
python -m pip install scons
python --version
scons --version
- name: Compilation
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/

View File

@ -4,6 +4,7 @@ on: [push, pull_request]
# Global Cache Settings
# SCONS_CACHE for windows must be set in the build environment
env:
GODOT_BASE_BRANCH: master
SCONS_CACHE_MSVC_CONFIG: true
SCONS_CACHE_LIMIT: 4096
@ -18,19 +19,18 @@ jobs:
steps:
- uses: actions/checkout@v2
# 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.
# Upload cache on completion and check it out now
# Editing this is pretty dangerous for Windows since it can break and needs to be properly tested with a fresh cache.
- name: Load .scons_cache directory
id: windows-editor-cache
uses: RevoluPowered/cache@v2.1
with:
path: /.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
@ -73,18 +73,17 @@ jobs:
- uses: actions/checkout@v2
# 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.
# Editing this is pretty dangerous for Windows since it can break and needs to be properly tested with a fresh cache.
- name: Load .scons_cache directory
id: windows-template-cache
uses: RevoluPowered/cache@v2.1
with:
path: /.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
@ -102,6 +101,7 @@ jobs:
python -m pip install scons pywin32
python --version
scons --version
- name: Compilation
env:
SCONS_CACHE: /.scons_cache/