Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hacks for running (and screenshotting) the examples in CI on a github runner #9220

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
10af3c9
hacks for running the examples on CI on a github runner
mockersf Jul 18, 2023
f4df197
use git patch instead of sed
mockersf Jul 24, 2023
4b686f2
add an option to ignore stress tests
mockersf Jul 24, 2023
34498ec
ignore whitespace to be able to run on windows
mockersf Jul 24, 2023
4b49908
50 frames after screenshots are not enough on some examples on windows
mockersf Jul 25, 2023
6c12bce
some more time to get the screenshot
mockersf Jul 25, 2023
3afdb5b
log failure to get the screenshot
mockersf Jul 25, 2023
fd0ca54
still longer...
mockersf Jul 25, 2023
a55bac0
example run can report in files
mockersf Jul 26, 2023
ddc187d
also log category
mockersf Jul 27, 2023
9c22bb5
report example duration in status
mockersf Jul 27, 2023
5d29ec3
randomize example order in a deterministic way
mockersf Jul 27, 2023
ab175bc
50 more frames to get screenshot
mockersf Jul 30, 2023
ea24b06
still longer
mockersf Jul 31, 2023
54387db
back to 350
mockersf Jul 31, 2023
f722562
can take example list to run from a file
mockersf Jul 31, 2023
f9f762c
don't run anything if an empty file is given
mockersf Jul 31, 2023
71bde09
log stdout and stderr
mockersf Jul 31, 2023
974cb25
update patch
mockersf Jul 31, 2023
2408da8
update patch
mockersf Jul 31, 2023
bb1c3ec
update patch
mockersf Jul 31, 2023
c395fd2
also log successes when not taking a screenshot
mockersf Aug 1, 2023
ea3741b
back to 300 frames?
mockersf Aug 3, 2023
8fc28ed
less frames?
mockersf Aug 3, 2023
c402085
remove rogue print
mockersf Aug 30, 2023
826773c
support for required-features in examples
mockersf Sep 9, 2023
fcdd04d
separate step that just build
mockersf Sep 9, 2023
14e772b
fixed default window position
mockersf Sep 23, 2023
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
16 changes: 16 additions & 0 deletions tools/example-showcase/extra-window-resized-events.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/crates/bevy_winit/src/lib.rs b/crates/bevy_winit/src/lib.rs
index 46b3e3e19..81ffad2b5 100644
--- a/crates/bevy_winit/src/lib.rs
+++ b/crates/bevy_winit/src/lib.rs
@@ -432,6 +432,11 @@ pub fn winit_runner(mut app: App) {
};

runner_state.window_event_received = true;
+ event_writers.window_resized.send(WindowResized {
+ window: window_entity,
+ width: window.width(),
+ height: window.height(),
+ });

match event {
WindowEvent::Resized(size) => {
13 changes: 13 additions & 0 deletions tools/example-showcase/fixed-window-position.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/crates/bevy_window/src/window.rs b/crates/bevy_window/src/window.rs
index 10bdd8fe8..dda272569 100644
--- a/crates/bevy_window/src/window.rs
+++ b/crates/bevy_window/src/window.rs
@@ -232,7 +232,7 @@ impl Default for Window {
cursor: Default::default(),
present_mode: Default::default(),
mode: Default::default(),
- position: Default::default(),
+ position: WindowPosition::Centered(MonitorSelection::Primary),
resolution: Default::default(),
internal: Default::default(),
composite_alpha_mode: Default::default(),
15 changes: 15 additions & 0 deletions tools/example-showcase/reduce-light-cluster-config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/crates/bevy_pbr/src/light.rs b/crates/bevy_pbr/src/light.rs
index 3e8c0d451..07aa7d586 100644
--- a/crates/bevy_pbr/src/light.rs
+++ b/crates/bevy_pbr/src/light.rs
@@ -694,8 +694,8 @@ impl Default for ClusterConfig {
// 24 depth slices, square clusters with at most 4096 total clusters
// use max light distance as clusters max `Z`-depth, first slice extends to 5.0
Self::FixedZ {
- total: 4096,
- z_slices: 24,
+ total: 128,
+ z_slices: 4,
z_config: ClusterZConfig::default(),
dynamic_resizing: true,
}
21 changes: 21 additions & 0 deletions tools/example-showcase/remove-desktop-app-mode.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/crates/bevy_winit/src/winit_config.rs b/crates/bevy_winit/src/winit_config.rs
index c71a92814..b138d07a0 100644
--- a/crates/bevy_winit/src/winit_config.rs
+++ b/crates/bevy_winit/src/winit_config.rs
@@ -47,15 +47,7 @@ impl WinitSettings {
/// [`Reactive`](UpdateMode::Reactive) if windows have focus,
/// [`ReactiveLowPower`](UpdateMode::ReactiveLowPower) otherwise.
pub fn desktop_app() -> Self {
- WinitSettings {
- focused_mode: UpdateMode::Reactive {
- wait: Duration::from_secs(5),
- },
- unfocused_mode: UpdateMode::ReactiveLowPower {
- wait: Duration::from_secs(60),
- },
- ..Default::default()
- }
+ Self::game()
}

/// Returns the current [`UpdateMode`].
Loading