Skip to content

Commit 80b730c

Browse files
authored
CI test do not cover separated features (#6)
1 parent 54fbe15 commit 80b730c

File tree

6 files changed

+32
-9
lines changed

6 files changed

+32
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ jobs:
3131
run: |
3232
set -o pipefail
3333
cargo build --workspace --all-features --message-format json | clippy-sarif | tee rust-build-results.sarif | sarif-fmt
34+
- name: Build Debug Runtime
35+
run: |
36+
set -o pipefail
37+
cargo build -p godot-rust-script --features "runtime" --message-format json | clippy-sarif | tee rust-build-results.sarif | sarif-fmt
38+
- name: Build Debug Scripts
39+
run: |
40+
set -o pipefail
41+
cargo build -p godot-rust-script --features "scripts" --message-format json | clippy-sarif | tee rust-build-results.sarif | sarif-fmt
3442
- name: Build Release
3543
run: |
3644
set -o pipefail

rust-script/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ process_path = { workspace = true, optional = true }
1818
godot-rust-script-derive = { workspace = true, optional = true }
1919

2020
[dev-dependencies]
21-
tests-scripts-lib = { path = "../tests-scripts-lib", features = ["hot-reload"] }
21+
tests-scripts-lib = { path = "../tests-scripts-lib", features = ["test-hot-reload"] }
2222
godot-rust-script = { path = "./", features = ["runtime"] }
2323

2424
[features]

rust-script/src/runtime/metadata.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ use godot::{
1111

1212
use crate::{
1313
apply::Apply,
14-
script_registry::{CreateScriptInstanceData_TO, RemoteGodotScript_TO},
15-
RemoteScriptMetaData,
14+
script_registry::{CreateScriptInstanceData_TO, RemoteGodotScript_TO, RemoteScriptMetaData},
1615
};
1716

1817
#[derive(Debug)]

rust-script/src/runtime/mod.rs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ use self::rust_script_language::RustScriptLanguage;
2828
#[cfg(all(feature = "hot-reload", debug_assertions))]
2929
use hot_reloader::{HotReloadEntry, HotReloader};
3030

31+
#[cfg(all(feature = "hot-reload", debug_assertions))]
3132
#[macro_export]
3233
macro_rules! setup {
3334
($lib_crate:tt) => {
34-
#[cfg(all(feature = "hot-reload", debug_assertions))]
3535
#[$crate::private_export::hot_module(dylib = stringify!($lib_crate), lib_dir=process_path::get_dylib_path().and_then(|path| path.parent().map(std::path::Path::to_path_buf)).unwrap_or_default())]
3636
mod scripts_lib {
3737
use $crate::private_export::RVec;
@@ -50,21 +50,37 @@ macro_rules! setup {
5050

5151
pub use ::$lib_crate::__GODOT_RUST_SCRIPT_SRC_ROOT;
5252
}
53-
54-
#[cfg(not(all(feature = "hot-reload", debug_assertions)))]
53+
};
54+
}
55+
56+
#[cfg(not(all(feature = "hot-reload", debug_assertions)))]
57+
#[macro_export]
58+
macro_rules! setup {
59+
($lib_crate:tt) => {
5560
mod scripts_lib {
5661
pub use ::$lib_crate::{__godot_rust_script_init, __GODOT_RUST_SCRIPT_SRC_ROOT};
5762
}
5863
};
5964
}
6065

66+
#[cfg(not(all(feature = "hot-reload", debug_assertions)))]
67+
#[macro_export]
68+
macro_rules! init {
69+
() => {
70+
$crate::RustScriptExtensionLayer::new(
71+
scripts_lib::__godot_rust_script_init,
72+
scripts_lib::__GODOT_RUST_SCRIPT_SRC_ROOT,
73+
)
74+
};
75+
}
76+
77+
#[cfg(all(feature = "hot-reload", debug_assertions))]
6178
#[macro_export]
6279
macro_rules! init {
6380
() => {
6481
$crate::RustScriptExtensionLayer::new(
6582
scripts_lib::__godot_rust_script_init,
6683
scripts_lib::__GODOT_RUST_SCRIPT_SRC_ROOT,
67-
#[cfg(all(feature = "hot-reload", debug_assertions))]
6884
scripts_lib::subscribe,
6985
)
7086
};

rust-script/src/shared.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use abi_stable::std_types::RVec;
22

3-
use crate::RemoteScriptMetaData;
3+
use crate::script_registry::RemoteScriptMetaData;
44

55
pub type BindingInit = godot::sys::GodotBinding;
66

tests-scripts-lib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ crate-type = ["dylib", "rlib"]
1010
godot-rust-script = { path = "../rust-script", features = ["hot-reload", "scripts"] }
1111

1212
[features]
13-
hot-reload = ["godot-rust-script/hot-reload"]
13+
test-hot-reload = ["godot-rust-script/hot-reload"]
1414

1515

1616

0 commit comments

Comments
 (0)