Skip to content

Commit

Permalink
Fix validation Job (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
naomijub authored Apr 5, 2024
1 parent 8e2d5f3 commit 007dd71
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Install Dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev
- name: Run cargo test
run: cargo test --workspace --no-default-features --release
run: cargo test --workspace --no-default-features --profile=ci

test_all:
name: Test all features
Expand All @@ -72,7 +72,7 @@ jobs:
- name: Install Dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev
- name: Run cargo test
run: cargo test --workspace --all-features --release
run: cargo test --workspace --all-features --profile=ci

test_all_macos:
strategy:
Expand All @@ -97,7 +97,7 @@ jobs:
- name: Install stable@stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run cargo test
run: cargo test --workspace --all-features --release
run: cargo test --workspace --all-features --profile=ci

# Run cargo clippy -- -D warnings
clippy_check:
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/example_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
branches:
- main

permissions:
contents: write

env:
CARGO_TERM_COLOR: always
NIGHTLY_TOOLCHAIN: nightly
Expand Down Expand Up @@ -49,19 +52,19 @@ jobs:
target: x86_64-unknown-linux-gnu
- name: Build bevy
# this uses the same command as when running the example to ensure build is reused
run: TRACE_CHROME=trace-platformer.json CI_TESTING_CONFIG=.github/example-run/platformer.ron cargo +nightly build --example platformer --release --features "bevy_xpbd_3d,"bevy/bevy_ci_testing,bevy/trace_chrome,bevy/trace""
run: CARGO_PROFILE_RELEASE_DEBUG=true TRACE_CHROME=trace-platformer.json CI_TESTING_CONFIG=.github/example-run/platformer.ron cargo +nightly build --example platformer --profile=ci --features "bevy_xpbd_3d,bevy/bevy_ci_testing,bevy/trace_chrome,bevy/trace,backtrace"
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -Z location-detail=none -Z threads=24"
RUSTFLAGS: "-C debuginfo=0"
- name: Run examples
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -Z location-detail=none -Z threads=24"
RUSTFLAGS: "-C debuginfo=0"
run: |
example_name=`basename plaformer.ron`
echo -n $example_name > last_example_run
echo "running platformer - "`date`
time TRACE_CHROME=trace-platformer.json CI_TESTING_CONFIG=.github/example-run/platformer.ron xvfb-run cargo +nightly run --release --example platformer --features "bevy_xpbd_3d,"bevy/bevy_ci_testing,bevy/trace_chrome,bevy/trace""
time CARGO_PROFILE_RELEASE_DEBUG=true TRACE_CHROME=trace-platformer.json CI_TESTING_CONFIG=.github/example-run/platformer.ron xvfb-run cargo +nightly run --profile=ci --example platformer --features "backtrace,bevy_xpbd_3d,bevy/bevy_ci_testing,bevy/trace_chrome,bevy/trace"
sleep 10
if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
mkdir screenshots-platformer
Expand Down Expand Up @@ -119,19 +122,19 @@ jobs:
target: x86_64-unknown-linux-gnu
- name: Build bevy
# this uses the same command as when running the example to ensure build is reused
run: TRACE_CHROME=trace-spawn_prefab_with_physics.json CI_TESTING_CONFIG=.github/example-run/spawn_prefab_with_physics.ron cargo +nightly build --example spawn_prefab_with_physics --release --features "bevy_xpbd_3d,"bevy/bevy_ci_testing,bevy/trace_chrome,bevy/trace""
run: TRACE_CHROME=trace-spawn_prefab_with_physics.json CI_TESTING_CONFIG=.github/example-run/spawn_prefab_with_physics.ron cargo +nightly build --example spawn_prefab_with_physics --profile=ci --features "bevy_xpbd_3d,bevy/bevy_ci_testing,bevy/trace_chrome,bevy/trace"
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -Z location-detail=none -Z threads=24"
RUSTFLAGS: "-C debuginfo=0"
- name: Run examples
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -Z location-detail=none -Z threads=24"
RUSTFLAGS: "-C debuginfo=0"
run: |
example_name=`basename plaformer.ron`
echo -n $example_name > last_example_run
echo "running spawn_prefab_with_physics - "`date`
time TRACE_CHROME=trace-spawn_prefab_with_physics.json CI_TESTING_CONFIG=.github/example-run/spawn_prefab_with_physics.ron xvfb-run cargo +nightly run --release --example spawn_prefab_with_physics --features "bevy_xpbd_3d,"bevy/bevy_ci_testing,bevy/trace_chrome,bevy/trace""
time TRACE_CHROME=trace-spawn_prefab_with_physics.json CI_TESTING_CONFIG=.github/example-run/spawn_prefab_with_physics.ron xvfb-run cargo +nightly run --profile=ci --example spawn_prefab_with_physics --features "bevy_xpbd_3d,bevy/bevy_ci_testing,bevy/trace_chrome,bevy/trace"
sleep 10
if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
mkdir screenshots-spawn_prefab_with_physics
Expand Down
81 changes: 80 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,22 @@ egui_file = "0.15"
egui-gizmo = "0.16.1"
egui-toast = "0.12.1"
image = {version = "0.24.8", feature = ["png"] }

pretty-type-name = "1"
rand = "*"
ron = "0.8"
serde = "1"

# Community Modules
space_bevy_xpbd_plugin = { version = "0.6.0", path = "modules/bevy_xpbd_plugin"}
game_app = { version = "0.1.0", path = "game" }
bevy_xpbd_3d = { version = "0.4.2", default-features = false }
rand = "*"

[dependencies]
bevy.workspace = true
space_editor_ui.workspace = true
space_prefab.workspace = true
game_app.workspace = true
backtrace-on-stack-overflow = {version = "0.3", optional = true}

# Modules for external crates
space_bevy_xpbd_plugin = { workspace = true, optional = true }
Expand Down Expand Up @@ -122,7 +122,17 @@ opt-level = 1
[profile.dev.package."*"]
opt-level = 3

[profile.ci]
inherits = "dev"
opt-level = 0
debug = 0
strip = "none"
lto = false
codegen-units = 256
incremental = true

[features]
backtrace = ["backtrace-on-stack-overflow"]
bevy_xpbd_3d = ["dep:space_bevy_xpbd_plugin"]
persistence_editor = []
no_event_registration = ["space_prefab/no_event_registration"]
Expand Down
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ use space_editor::SpaceEditorPlugin;
use space_editor_ui::{game_mode_changed, settings::GameModeSettings, simple_editor_setup};

fn main() {
// Backtrace only supported on unix
#[cfg(feature = "backtrace")]
unsafe {
backtrace_on_stack_overflow::enable()
};

Check warning on line 12 in src/main.rs

View check run for this annotation

Codecov / codecov/patch

src/main.rs#L7-L12

Added lines #L7 - L12 were not covered by tests
let mut app = App::new();
app.add_plugins(DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
Expand Down

0 comments on commit 007dd71

Please sign in to comment.