Skip to content

Commit

Permalink
Merge pull request #92043 from akien-mga/ci-scons-3.0.0-python-3.6
Browse files Browse the repository at this point in the history
SCons: Bump min version to 3.1.2, test it on CI with one Linux job
  • Loading branch information
akien-mga authored and nongvantinh committed May 18, 2024
2 parents 85463fd + a63c37d commit 22775e5
Show file tree
Hide file tree
Showing 22 changed files with 404 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/actions/godot-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ inputs:
sconsflags:
default: ""
scons-cache:
description: The scons cache path.
description: The SCons cache path.
default: "${{ github.workspace }}/.scons-cache/"
scons-cache-limit:
description: The scons cache size limit.
description: The SCons cache size limit.
# actions/cache has 10 GiB limit, and GitHub runners have a 14 GiB disk.
# Limit to 7 GiB to avoid having the extracted cache fill the disk.
default: 7168
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/godot-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ inputs:
description: The cache base name (job name by default).
default: "${{github.job}}"
scons-cache:
description: The scons cache path.
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
# Upload cache on completion and check it out now.
- name: Load SCons cache directory
uses: actions/cache@v4
with:
path: ${{inputs.scons-cache}}
Expand Down
21 changes: 12 additions & 9 deletions .github/actions/godot-deps/action.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
name: Setup python and scons
description: Setup python, install the pip version of scons.
name: Setup Python and SCons
description: Setup Python, install the pip version of SCons.
inputs:
python-version:
description: The python version to use.
description: The Python version to use.
default: "3.x"
python-arch:
description: The python architecture.
description: The Python architecture.
default: "x64"
scons-version:
description: The SCons version to use.
default: "4.7.0"
runs:
using: "composite"
steps:
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
# Semantic version range syntax or exact version of a Python version.
python-version: ${{ inputs.python-version }}
# Optional - x64 or x86 architecture, defaults to x64
# Optional - x64 or x86 architecture, defaults to x64.
architecture: ${{ inputs.python-arch }}

- name: Setup scons
- name: Setup SCons
shell: bash
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons==4.7.0
python -m pip install wheel
python -m pip install scons==${{ inputs.scons-version }}
scons --version
2 changes: 1 addition & 1 deletion .github/workflows/android_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: ./.github/actions/godot-cache
continue-on-error: true

- name: Setup python and scons
- name: Setup Python and SCons
uses: ./.github/actions/godot-deps

- name: Compilation (arm32)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/godot_cpp_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
submodules: recursive

- name: Setup python and scons
- name: Setup Python and SCons
uses: ./.github/actions/godot-deps

# Checkout godot-cpp
Expand All @@ -47,7 +47,7 @@ jobs:
cp -f godot-api/gdextension_interface.h godot-cpp/gdextension/
cp -f godot-api/extension_api.json godot-cpp/gdextension/
# TODO: Add caching to the scons build and store it for CI via the godot-cache
# TODO: Add caching to the SCons build and store it for CI via the godot-cache
# action.

# Build godot-cpp test extension
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: ./.github/actions/godot-cache
continue-on-error: true

- name: Setup python and scons
- name: Setup Python and SCons
uses: ./.github/actions/godot-deps

- name: Compilation (arm64)
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
tests: true
# Skip 2GiB artifact speeding up action.
artifact: false
# Test our oldest supported SCons/Python versions on one arbitrary editor build.
legacy-scons: true

- name: Editor with ThreadSanitizer (target=editor, tests=yes, dev_build=yes, use_tsan=yes, use_llvm=yes, linker=lld)
cache-name: linux-editor-thread-sanitizer
Expand Down Expand Up @@ -115,9 +117,18 @@ jobs:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

- name: Setup python and scons
- name: Setup Python and SCons
if: ${{ ! matrix.legacy-scons }}
uses: ./.github/actions/godot-deps

- name: Setup Python and SCons (legacy versions)
if: ${{ matrix.legacy-scons }}
uses: ./.github/actions/godot-deps
with:
# Sync with Ensure*Version in SConstruct.
python-version: 3.6
scons-version: 3.1.2

- name: Setup GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

- name: Setup python and scons
- name: Setup Python and SCons
uses: ./.github/actions/godot-deps

- name: Setup Vulkan SDK
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/web_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

- name: Setup python and scons
- name: Setup Python and SCons
uses: ./.github/actions/godot-deps

- name: Compilation
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true

- name: Setup python and scons
- name: Setup Python and SCons
uses: ./.github/actions/godot-deps

- name: Download Direct3D 12 SDK components
Expand Down
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

EnsureSConsVersion(3, 0, 0)
EnsureSConsVersion(3, 1, 2)
EnsurePythonVersion(3, 6)

# System
Expand Down
16 changes: 16 additions & 0 deletions doc/classes/ColorPalette.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ColorPalette" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A resource class for managing a palette of colors.
</brief_description>
<description>
The ColorPalette class is designed to store and manage a collection of colors. This class is useful in scenarios where a predefined set of colors is required, such as for creating themes, designing user interfaces, or managing game assets.
</description>
<tutorials>
</tutorials>
<members>
<member name="colors" type="PackedColorArray" setter="set_colors" getter="get_colors" default="PackedColorArray()">
A PackedColorArray containing the colors in the palette. This array holds the color data that can be accessed and manipulated through the set_colors and get_colors methods. By default, it initializes as an empty array.
</member>
</members>
</class>
15 changes: 15 additions & 0 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2636,6 +2636,11 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
quick_open->popup_dialog("Script", true);
quick_open->set_title(TTR("Quick Open Script..."));

} break;
case FILE_QUICK_OPEN_PALETTE: {
quick_open->popup_dialog("ColorPalette", true);
quick_open->set_title(TTR("Quick Open Color Palette..."));

} break;
case FILE_OPEN_PREV: {
if (previous_scenes.is_empty()) {
Expand Down Expand Up @@ -3384,6 +3389,10 @@ void EditorNode::_update_file_menu_closed() {
file_menu->set_item_disabled(file_menu->get_item_index(FILE_OPEN_PREV), false);
}

void EditorNode::_palette_quick_open_dialog() {
_menu_option_confirm(FILE_QUICK_OPEN_PALETTE, false);
}

VBoxContainer *EditorNode::get_main_screen_control() {
return main_screen_vbox;
}
Expand Down Expand Up @@ -3884,6 +3893,10 @@ void EditorNode::setup_color_picker(ColorPicker *p_picker) {

p_picker->set_color_mode((ColorPicker::ColorModeType)default_color_mode);
p_picker->set_picker_shape((ColorPicker::PickerShapeType)picker_shape);

p_picker->set_quick_open_callback(callable_mp(this, &EditorNode::_palette_quick_open_dialog));
p_picker->set_palette_saved_callback(callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::update_file));
palette_file_selected_callback = callable_mp(p_picker, &ColorPicker::_palette_file_selected);
}

bool EditorNode::is_scene_open(const String &p_path) {
Expand Down Expand Up @@ -4400,6 +4413,8 @@ void EditorNode::_quick_opened() {
const String &res_path = files[i];
if (open_scene_dialog || ClassDB::is_parent_class(ResourceLoader::get_resource_type(res_path), "PackedScene")) {
open_request(res_path);
} else if (ClassDB::is_parent_class(ResourceLoader::get_resource_type(res_path), "ColorPalette")) {
palette_file_selected_callback.call_deferred(files[i]);
} else {
load_resource(res_path);
}
Expand Down
3 changes: 3 additions & 0 deletions editor/editor_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ class EditorNode : public Node {
FILE_QUICK_OPEN,
FILE_QUICK_OPEN_SCENE,
FILE_QUICK_OPEN_SCRIPT,
FILE_QUICK_OPEN_PALETTE,
FILE_OPEN_PREV,
FILE_CLOSE,
FILE_CLOSE_OTHERS,
Expand Down Expand Up @@ -423,6 +424,7 @@ class EditorNode : public Node {
Timer *editor_layout_save_delay_timer = nullptr;
Timer *scan_changes_timer = nullptr;
Button *distraction_free = nullptr;
Callable palette_file_selected_callback;

EditorBottomPanel *bottom_panel = nullptr;

Expand Down Expand Up @@ -539,6 +541,7 @@ class EditorNode : public Node {
void _export_as_menu_option(int p_idx);
void _update_file_menu_opened();
void _update_file_menu_closed();
void _palette_quick_open_dialog();

void _remove_plugin_from_enabled(const String &p_name);
void _plugin_over_edit(EditorPlugin *p_plugin, Object *p_object);
Expand Down

0 comments on commit 22775e5

Please sign in to comment.