Skip to content
Open
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
3 changes: 3 additions & 0 deletions .github/workflows/build_engine_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,23 @@ jobs:
with:
version: ${{ inputs.version }}
version_ref: ${{ inputs.version_ref }}
tests: ${{ github.event_name != 'release' }}

macos-build:
name: 🍎 macOS
uses: ./.github/workflows/build_macos.yml
with:
version: ${{ inputs.version }}
version_ref: ${{ inputs.version_ref }}
tests: ${{ github.event_name != 'release' }}

windows-build:
name: 🏁 Windows
uses: ./.github/workflows/build_windows.yml
with:
version: ${{ inputs.version }}
version_ref: ${{ inputs.version_ref }}
tests: ${{ github.event_name != 'release' }}

web-build:
name: 🌐 Web
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
env:
# 4.4
SCONSFLAGS: >-
strict_checks=yes
debug_symbols=no
module_text_server_fb_enabled=yes
# 4.5+
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ on:
description: "Godot engine commit reference"
required: true
type: string
tests:
type: boolean
default: true

# Global Settings
env:
# 4.4
SCONSFLAGS: >-
module_text_server_fb_enabled=yes
strict_checks=yes
module_text_server_fb_enabled=yes
strict_checks=yes
# 4.5
# Ideally we'd use dev_mode=yes. Unfortunately, v8 headers contain warnings. So we manually set some dev_mode options.
SCONS_FLAGS: >-
Expand Down Expand Up @@ -54,7 +57,6 @@ jobs:
cache-name: linux-template-${{inputs.version}}-debug-v8
sconsflags: debug_symbols=no
target: template_debug
bin: ./bin/godot.linuxbsd.template_debug.x86_64.v8
cache-limit: 1

- name: Editor (target=editor, qjs_ng)
Expand Down Expand Up @@ -142,6 +144,7 @@ jobs:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
platform: linuxbsd
target: ${{ matrix.target }}
tests: ${{ inputs.tests && matrix.target == 'editor' }}
scons-cache-limit: ${{ matrix.cache-limit }}

- name: Compilation [4.5+]
Expand All @@ -150,6 +153,7 @@ jobs:
with:
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.sconsflags }}
platform: linuxbsd
tests: ${{ inputs.tests && matrix.target == 'editor' }}

- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
Expand All @@ -166,3 +170,12 @@ jobs:
uses: ./.github/actions/upload-artifact
with:
name: ${{ matrix.cache-name }}

- name: Unit tests
if: ${{ inputs.tests && matrix.target == 'editor' }}
env:
BIN: ./bin/godot.linuxbsd.editor.x86_64
run: |
${{ env.BIN }} --version
${{ env.BIN }} --help
${{ env.BIN }} --headless --test --test-case="[jsb]*" --force-colors
20 changes: 18 additions & 2 deletions .github/workflows/build_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ on:
description: "Godot engine commit reference"
required: true
type: string
tests:
type: boolean
default: true

# Global Settings
env:
# 4.4
SCONSFLAGS: >-
module_text_server_fb_enabled=yes
strict_checks=yes
module_text_server_fb_enabled=yes
strict_checks=yes
# 4.5
# Ideally we'd use dev_mode=yes. Unfortunately, v8 headers contain warnings. So we manually set some dev_mode options.
SCONS_FLAGS: >-
Expand Down Expand Up @@ -143,6 +146,7 @@ jobs:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }} arch=x86_64 vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }}
platform: macos
target: ${{ matrix.target }}
tests: ${{ inputs.tests && matrix.target == 'editor' }}
scons-cache-limit: 0 # Only cap on second run to avoid purging unnecessarily

- name: Compilation [4.5+] (x86_64)
Expand All @@ -152,6 +156,7 @@ jobs:
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.sconsflags }} arch=x86_64 vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }}
platform: macos
target: ${{ matrix.target }}
tests: ${{ inputs.tests && matrix.target == 'editor' }}

- name: Compilation [4.4] (arm64)
if: inputs.version == '4.4'
Expand All @@ -160,6 +165,7 @@ jobs:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }} arch=arm64 vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }}
platform: macos
target: ${{ matrix.target }}
tests: ${{ inputs.tests && matrix.target == 'editor' }}
scons-cache-limit: ${{ matrix.cache-limit }}

- name: Compilation [4.5+] (arm64)
Expand All @@ -169,6 +175,7 @@ jobs:
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.sconsflags }} arch=arm64 vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }}
platform: macos
target: ${{ matrix.target }}
tests: ${{ inputs.tests && matrix.target == 'editor' }}

- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
Expand All @@ -193,6 +200,15 @@ jobs:
with:
name: ${{ matrix.cache-name }}

- name: Unit tests
if: ${{ inputs.tests && matrix.target == 'editor' }}
env:
BIN: ./bin/godot.macos.editor.universal
run: |
${{ env.BIN }} --version
${{ env.BIN }} --help
${{ env.BIN }} --headless --test --test-case="[jsb]*" --force-colors

build-macos-apps:
needs:
- build-macos
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ on:
env:
# 4.4
SCONSFLAGS: >-
debug_symbols=no
use_closure_compiler=yes
strict_checks=yes
deprecated=no
lto=none
use_assertions=no
debug_symbols=no
use_closure_compiler=yes
strict_checks=yes
deprecated=no
lto=none
use_assertions=no
use_safe_heap=yes
# 4.5+
# Ideally we'd use dev_mode=yes. Unfortunately, v8 headers contain warnings. So we manually set some dev_mode options.
Expand Down
31 changes: 22 additions & 9 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ on:
description: "Godot engine commit reference"
required: true
type: string
tests:
type: boolean
default: true

# Global Settings
# SCONS_CACHE for windows must be set in the build environment
env:
# 4.4
SCONSFLAGS: >-
module_text_server_fb_enabled=yes
d3d12=yes
strict_checks=yes
"angle_libs=${{ github.workspace }}/"
# 4.5+
module_text_server_fb_enabled=yes
d3d12=yes
strict_checks=yes
"angle_libs=${{ github.workspace }}/"# 4.5+
# Ideally we'd use dev_mode=yes. Unfortunately, v8 headers contain warnings. So we manually set some dev_mode options.
SCONS_FLAGS: >-
verbose=yes
Expand Down Expand Up @@ -69,10 +71,10 @@ jobs:
target: editor
# Skip debug symbols, they're way too big with MSVC.
sconsflags: >-
debug_symbols=no
vsproj=yes
vsproj_gen_only=no
windows_subsystem=console
debug_symbols=no
vsproj=yes
vsproj_gen_only=no
windows_subsystem=console
use_quickjs_ng=yes
cache-limit: 2
engine: qjs_ng
Expand Down Expand Up @@ -166,6 +168,7 @@ jobs:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
platform: windows
target: ${{ matrix.target }}
tests: ${{ inputs.tests && matrix.target == 'editor' }}
scons-cache-limit: ${{ matrix.cache-limit }}

- name: Compilation (4.5+)
Expand All @@ -175,6 +178,7 @@ jobs:
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.sconsflags }}
platform: windows
target: ${{ matrix.target }}
tests: ${{ inputs.tests && matrix.target == 'editor' }}

- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
Expand All @@ -190,3 +194,12 @@ jobs:
uses: ./.github/actions/upload-artifact
with:
name: ${{ matrix.cache-name }}

- name: Unit tests
if: ${{ inputs.tests && matrix.target == 'editor' }}
env:
BIN: ./bin/godot.windows.editor.x86_64.exe
run: |
${{ env.BIN }} --version
${{ env.BIN }} --help
${{ env.BIN }} --headless --test --test-case="[jsb]*" --force-colors
9 changes: 8 additions & 1 deletion tests/jsb_test_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#include "../weaver/jsb_script_language.h"
#include "tests/test_macros.h"

#include <chrono>
#include <thread>

#define JSB_TESTS_EXECUTION_SCOPE(env) const jsb::tests::V8ContextScope JSB_CONCAT(unique_, __COUNTER__)(env)

namespace jsb::tests
Expand Down Expand Up @@ -110,7 +113,9 @@ namespace jsb::tests
CHECK(FileAccess::exists("project.godot"));
// MESSAGE("init GodotJSScriptLanguage on thread ", Thread::get_caller_id());

install_npm();
install_npm();
// Wait for 1 second until ./node_modules has been created
std::this_thread::sleep_for(std::chrono::seconds(1));
compile_scripts();
ignore_directories();
GodotJSScriptLanguage::get_singleton()->init();
Expand Down Expand Up @@ -143,6 +148,8 @@ namespace jsb::tests
const String exe_path = OS::get_singleton()->get_name() != "Windows" ? "node" : "node.exe";
const Error err = OS::get_singleton()->create_process(exe_path, args);
CHECK(err == OK);
// Wait for 1 second until ./.godot has been created
std::this_thread::sleep_for(std::chrono::seconds(1));
CHECK(FileAccess::exists("./.godot/GodotJS/test_01.js"));
}

Expand Down
2 changes: 1 addition & 1 deletion tests/test_jsb_any_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ console.assert(!gd.is_instance_valid(node));
Error err;
GodotJSScriptLanguage::get_singleton()->eval_source(R"--(
let gd = require("godot");
let mod = require("test_01");
let mod = require(".godot/GodotJS/test_01");
console.assert(typeof mod === "object");
console.assert(mod.call_me() == 123);
console.assert(typeof mod.default === "function");
Expand Down