Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/actions/godot-cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Setup Godot build cache
description: Setup Godot build cache.
inputs:
cache-name:
description: The cache base name (job name by default).
default: "${{github.job}}"
scons-cache:
description: The scons cache path.
default: "${{github.workspace}}/.scons-cache/"
runs:
using: "composite"
steps:
# Upload cache on completion and check it out now
- name: Load .scons_cache directory
uses: actions/cache@v3
with:
path: ${{inputs.scons-cache}}
key: ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
restore-keys: |
${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}
${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}
26 changes: 25 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Continuous integration
on: [push, pull_request]

env:
# Only used for the cache key. Increment version to force clean build.
GODOT_BASE_BRANCH: master

concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}
cancel-in-progress: true

jobs:
build:
name: ${{ matrix.name }}
Expand All @@ -14,54 +22,70 @@ jobs:
platform: linux
artifact-name: godot-cpp-linux-glibc2.27-x86_64-release
artifact-path: bin/libgodot-cpp.linux.release.x86_64.a
cache-name: linux-x86_64

- name: 🐧 Linux (GCC, Double Precision)
os: ubuntu-18.04
platform: linux
artifact-name: godot-cpp-linux-glibc2.27-x86_64-double-release
artifact-path: bin/libgodot-cpp.linux.release.x86_64.a
flags: float=64
cache-name: linux-x86_64-f64

- name: 🏁 Windows (x86_64, MSVC)
os: windows-2019
platform: windows
artifact-name: godot-cpp-windows-msvc2019-x86_64-release
artifact-path: bin/libgodot-cpp.windows.release.x86_64.lib
cache-name: windows-x86_64-msvc

- name: 🏁 Windows (x86_64, MinGW)
os: windows-2019
platform: windows
artifact-name: godot-cpp-linux-mingw-x86_64-release
artifact-path: bin/libgodot-cpp.windows.release.x86_64.a
flags: use_mingw=yes
cache-name: windows-x86_64-mingw

- name: 🍎 macOS (universal)
os: macos-11
platform: macos
artifact-name: godot-cpp-macos-universal-release
artifact-path: bin/libgodot-cpp.macos.release.universal.a
flags: arch=universal
cache-name: macos-universal

- name: 🤖 Android (arm64)
os: ubuntu-18.04
platform: android
artifact-name: godot-cpp-android-arm64-release
artifact-path: bin/libgodot-cpp.android.release.arm64.a
flags: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME arch=arm64
cache-name: android-arm64

- name: 🍏 iOS (arm64)
os: macos-11
platform: ios
artifact-name: godot-cpp-ios-arm64-release
artifact-path: bin/libgodot-cpp.ios.release.arm64.a
flags: arch=arm64
cache-name: ios-arm64

env:
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Godot build cache
uses: ./.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 All @@ -83,7 +107,7 @@ jobs:

- name: Build godot-cpp (debug)
run: |
scons platform=${{ matrix.platform }} target=debug generate_bindings=yes ${{ matrix.flags }}
scons platform=${{ matrix.platform }} target=debug ${{ matrix.flags }}

- name: Build test without rebuilding godot-cpp (debug)
run: |
Expand Down