Skip to content

Commit cc1fbf0

Browse files
committed
Include register-docs feature in CI
1 parent 01678e5 commit cc1fbf0

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

.github/workflows/full-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ jobs:
324324
os: ubuntu-20.04
325325
artifact-name: linux-nightly
326326
godot-binary: godot.linuxbsd.editor.dev.x86_64
327-
rust-extra-args: --features itest/experimental-threads,itest/codegen-full-experimental,godot/api-custom,godot/serde
327+
rust-extra-args: --features itest/experimental-threads,itest/codegen-full-experimental,godot/api-custom,godot/serde,itest/register-docs
328328

329329
- name: linux-release
330330
os: ubuntu-20.04

.github/workflows/minimal-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ jobs:
164164
os: ubuntu-20.04
165165
artifact-name: linux-nightly
166166
godot-binary: godot.linuxbsd.editor.dev.x86_64
167-
rust-extra-args: --features itest/experimental-threads,itest/codegen-full-experimental,godot/api-custom,godot/serde
167+
rust-extra-args: --features itest/experimental-threads,itest/codegen-full-experimental,godot/api-custom,godot/serde,itest/register-docs
168168

169169
# Linux compat
170170

godot-core/src/init/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ unsafe fn gdext_on_level_init(level: InitLevel) {
144144
}
145145
InitLevel::Editor => {
146146
#[cfg(all(since_api = "4.3", feature = "docs"))]
147-
crate::docs::register();
147+
// SAFETY: Godot binding is initialized, and this is called from the main thread.
148+
unsafe {
149+
crate::docs::register();
150+
}
148151
}
149152
_ => (),
150153
}

itest/rust/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ crate-type = ["cdylib"]
1313
default = []
1414
codegen-full-experimental = ["godot/__codegen-full", "godot/experimental-godot-api"]
1515
experimental-threads = ["godot/experimental-threads"]
16+
register-docs = ["godot/register-docs"] # TODO remove as soon as constant_test.rs checks bitfields with #[constant] proc-macro
1617
serde = ["dep:serde", "dep:serde_json", "godot/serde"]
1718

1819
# Do not add features here that are 1:1 forwarded to the `godot` crate, unless they are needed by itest itself.

itest/rust/src/register_tests/constant_test.rs

+3
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ impl godot::obj::cap::ImplementsGodotApi for HasOtherConstants {
166166
}
167167
}
168168

169+
// TODO once this is done via proc-macro, remove `register-docs` feature from itest, and update CI workflows.
169170
godot::sys::plugin_add!(
170171
__GODOT_PLUGIN_REGISTRY in ::godot::private;
171172
::godot::private::ClassPlugin {
@@ -174,6 +175,8 @@ godot::sys::plugin_add!(
174175
register_methods_constants_fn: ::godot::private::ErasedRegisterFn {
175176
raw: ::godot::private::callbacks::register_user_methods_constants::<HasOtherConstants>,
176177
},
178+
#[cfg(all(since_api = "4.3", feature = "register-docs"))]
179+
docs: None,
177180
},
178181
init_level: HasOtherConstants::INIT_LEVEL,
179182
}

0 commit comments

Comments
 (0)