Skip to content

Commit

Permalink
Include register-docs feature in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Jul 27, 2024
1 parent 01678e5 commit cc1fbf0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/full-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ jobs:
os: ubuntu-20.04
artifact-name: linux-nightly
godot-binary: godot.linuxbsd.editor.dev.x86_64
rust-extra-args: --features itest/experimental-threads,itest/codegen-full-experimental,godot/api-custom,godot/serde
rust-extra-args: --features itest/experimental-threads,itest/codegen-full-experimental,godot/api-custom,godot/serde,itest/register-docs

- name: linux-release
os: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/minimal-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ jobs:
os: ubuntu-20.04
artifact-name: linux-nightly
godot-binary: godot.linuxbsd.editor.dev.x86_64
rust-extra-args: --features itest/experimental-threads,itest/codegen-full-experimental,godot/api-custom,godot/serde
rust-extra-args: --features itest/experimental-threads,itest/codegen-full-experimental,godot/api-custom,godot/serde,itest/register-docs

# Linux compat

Expand Down
5 changes: 4 additions & 1 deletion godot-core/src/init/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ unsafe fn gdext_on_level_init(level: InitLevel) {
}
InitLevel::Editor => {
#[cfg(all(since_api = "4.3", feature = "docs"))]
crate::docs::register();
// SAFETY: Godot binding is initialized, and this is called from the main thread.
unsafe {
crate::docs::register();
}
}
_ => (),
}
Expand Down
1 change: 1 addition & 0 deletions itest/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ crate-type = ["cdylib"]
default = []
codegen-full-experimental = ["godot/__codegen-full", "godot/experimental-godot-api"]
experimental-threads = ["godot/experimental-threads"]
register-docs = ["godot/register-docs"] # TODO remove as soon as constant_test.rs checks bitfields with #[constant] proc-macro
serde = ["dep:serde", "dep:serde_json", "godot/serde"]

# Do not add features here that are 1:1 forwarded to the `godot` crate, unless they are needed by itest itself.
Expand Down
3 changes: 3 additions & 0 deletions itest/rust/src/register_tests/constant_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ impl godot::obj::cap::ImplementsGodotApi for HasOtherConstants {
}
}

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

0 comments on commit cc1fbf0

Please sign in to comment.