Skip to content

Commit

Permalink
Use SCons cache on CI to improve build times
Browse files Browse the repository at this point in the history
  • Loading branch information
dsnopek committed Jul 11, 2024
1 parent 831119f commit 77800cc
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/build-addon-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Build on push

on: [push, pull_request]

env:
# Only used for the cache key. Increment version to force clean build.
GODOT_BASE_BRANCH: master
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/

jobs:
build:
name: Building for ${{ matrix.name }} (${{ matrix.os }})
Expand All @@ -17,42 +22,49 @@ jobs:
flags: arch=x86_64
artifact_name: build-files-linux-x86_64
artifact_path: aar/demo/addons/godotopenxrvendors/.bin/linux/*/*/*.so
cache-name: linux-x86_64
# Not sure how to cross compile these
# - name: Linux (arm64)
# os: ubuntu-20.04
# platform: linux
# flags: arch=arm64
# artifact_name: build-files-linux-arm64
# artifact_name: build-files-linux-arm64
# artifact_path: aar/demo/addons/godotopenxrvendors/.bin/linux/*/*/*.so
# cache-name: linux-arm64
# - name: Linux (rv64)
# os: ubuntu-20.04
# platform: linux
# flags: arch=rv64
# artifact_name: build-files-linux-rv64
# artifact_path: aar/demo/addons/godotopenxrvendors/.bin/linux/*/*/*.so
# cache-name: linux-rv64
- name: Windows
os: windows-latest
platform: windows
artifact_name: build-files-windows
artifact_path: aar/demo/addons/godotopenxrvendors/.bin/windows/*/*/*.dll
cache-name: windows-x86_64
- name: MacOS
os: macos-latest
platform: macos
flags: arch=universal
artifact_name: build-files-macos
artifact_path: aar/demo/addons/godotopenxrvendors/.bin/macos/*/*.framework
cache-name: macos-universal
- name: Android AAR
os: ubuntu-20.04
platform: android
flags: arch=arm64
artifact_name: build-files-android-aar
artifact_path: aar/demo/addons/godotopenxrvendors/.bin/android/*/*.aar
cache-name: android-aar
- name: Android SO
os: ubuntu-20.04
platform: android
flags: arch=arm64
artifact_name: build-files-android-so
artifact_path: aar/demo/addons/godotopenxrvendors/.bin/android/*/*/*.so
cache-name: android-so

# Note, to satisfy the asset library we need to make sure our zip files have a root folder
# this is why we checkout into aar and build into asset
Expand All @@ -62,6 +74,11 @@ jobs:
with:
path: aar
submodules: recursive
- name: Setup Godot build cache
uses: ./aar/thirdparty/godot-cpp/.github/actions/godot-cache
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: Set up Python (for SCons)
uses: actions/setup-python@v4
with:
Expand Down

0 comments on commit 77800cc

Please sign in to comment.