Skip to content

Commit

Permalink
Creates dynamic linking feature to support incremental CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
naomijub committed Apr 7, 2024
1 parent a99149b commit 01f0424
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/example-run/external_plugin.ron
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(
exit_after: Some(1000),
exit_after: Some(200),
frame_time: Some(0.03),
screenshot_frames: [101],
screenshot_frames: [100],
)
4 changes: 2 additions & 2 deletions .github/example-run/platformer.ron
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(
exit_after: Some(1000),
exit_after: Some(200),
frame_time: Some(0.03),
screenshot_frames: [200],
screenshot_frames: [100],
)
4 changes: 2 additions & 2 deletions .github/example-run/spawn_prefab_with_physics.ron
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(
exit_after: Some(1000),
exit_after: Some(200),
frame_time: Some(0.03),
screenshot_frames: [101],
screenshot_frames: [100],
)
14 changes: 10 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ 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 --profile=ci
run: cargo test --workspace --no-default-features --profile=ci --features "dynamic_linking"
env:
CARGO_INCREMENTAL: 1

test_all:
name: Test all features
Expand All @@ -73,14 +75,16 @@ jobs:
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 --profile=ci
env:
CARGO_INCREMENTAL: 1

test_all_macos_n_windows:
strategy:
matrix:
os: [windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
name: Test ${{ matrix.os }} all features
timeout-minutes: 30
timeout-minutes: 60
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -97,9 +101,9 @@ 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
env:
CARGO_INCREMENTAL: 0
CARGO_INCREMENTAL: 1
RUSTFLAGS: "-C debuginfo=0"


Expand Down Expand Up @@ -129,6 +133,8 @@ jobs:
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev
- name: Run clippy
run: cargo clippy --all-features -- -D warnings
env:
CARGO_INCREMENTAL: 1

# Run cargo fmt --all -- --check
format:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
env:
CARGO_INCREMENTAL: 1
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/example_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ jobs:
# this uses the same command as when running the example to ensure build is reused
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
CARGO_INCREMENTAL: 1
RUSTFLAGS: "-C debuginfo=0"
- name: Run examples
env:
CARGO_INCREMENTAL: 0
CARGO_INCREMENTAL: 1
RUSTFLAGS: "-C debuginfo=0"
run: |
example_name=`basename plaformer.ron`
Expand Down Expand Up @@ -124,11 +124,11 @@ jobs:
# 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 --profile=ci --features "bevy_xpbd_3d,bevy/bevy_ci_testing,bevy/trace_chrome,bevy/trace"
env:
CARGO_INCREMENTAL: 0
CARGO_INCREMENTAL: 1
RUSTFLAGS: "-C debuginfo=0"
- name: Run examples
env:
CARGO_INCREMENTAL: 0
CARGO_INCREMENTAL: 1
RUSTFLAGS: "-C debuginfo=0"
run: |
example_name=`basename plaformer.ron`
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
# this uses the same command as when running the example to ensure build is reused
run: TRACE_CHROME=trace-external_plugin.json CI_TESTING_CONFIG=.github/example-run/external_plugin.ron cargo +nightly build --bin plugin_test --profile=ci --features "bevy/bevy_ci_testing,bevy/trace_chrome,bevy/trace"
env:
CARGO_INCREMENTAL: 0
CARGO_INCREMENTAL: 1
RUSTFLAGS: "-C debuginfo=0"
- name: Run examples
env:
Expand Down
12 changes: 11 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,17 @@ backtrace = ["backtrace-on-stack-overflow"]
bevy_xpbd_3d = ["dep:space_bevy_xpbd_plugin"]
persistence_editor = []
no_event_registration = ["space_prefab/no_event_registration"]
default = ["bevy_xpbd_3d", "persistence_editor", "bevy/dynamic_linking", "space_prefab/editor"]
dynamic_linking = [
"bevy/dynamic_linking",
"space_editor_ui/dynamic_linking",
"space_prefab/dynamic_linking",
]
default = [
"bevy_xpbd_3d",
"persistence_editor",
"space_prefab/editor",
"dynamic_linking"
]

[[example]]
name = "platformer"
Expand Down
10 changes: 10 additions & 0 deletions crates/editor_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ homepage.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
crate-type = ["dylib"]

[dependencies]
bevy.workspace = true

Expand All @@ -23,6 +26,13 @@ egui_dock.workspace = true
egui-toast.workspace = true

[features]
dynamic_linking = [
"bevy/dynamic_linking",
"space_prefab/dynamic_linking",
"space_undo/dynamic_linking",
"space_persistence/dynamic_linking",
"space_shared/dynamic_linking",
]
persistence_editor = []

[lints]
Expand Down
6 changes: 6 additions & 0 deletions crates/editor_tabs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ categories.workspace = true
repository.workspace = true
homepage.workspace = true

[lib]
crate-type = ["dylib"]

[features]
dynamic_linking = ["bevy/dynamic_linking",]

[dependencies]
bevy.workspace = true
bevy_egui.workspace = true
Expand Down
12 changes: 12 additions & 0 deletions crates/editor_ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ homepage.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
crate-type = ["dylib"]

[features]
dynamic_linking = [
"bevy/dynamic_linking",
"space_editor_core/dynamic_linking",
"space_editor_tabs/dynamic_linking",
"space_prefab/dynamic_linking",
"space_undo/dynamic_linking",
"space_persistence/dynamic_linking",
"space_shared/dynamic_linking",
]
persistence_editor = []

[dependencies]
Expand Down
5 changes: 5 additions & 0 deletions crates/persistence/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ repository.workspace = true
homepage.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
crate-type = ["dylib"]

[features]
dynamic_linking = ["bevy/dynamic_linking",]

[dependencies]
bevy.workspace = true
Expand Down
5 changes: 5 additions & 0 deletions crates/prefab/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ description = "Subcrate for the space_editor crate. Contains the prefab systems
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
dynamic_linking = [
"bevy/dynamic_linking",
"space_shared/dynamic_linking",
"space_undo/dynamic_linking",
]
no_event_registration = []
editor = []

Expand Down
2 changes: 2 additions & 0 deletions crates/shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ homepage.workspace = true


# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
dynamic_linking = ["bevy/dynamic_linking",]

[dependencies]
bevy.workspace = true
Expand Down
3 changes: 3 additions & 0 deletions crates/undo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ homepage.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
dynamic_linking = ["bevy/dynamic_linking",]

[dependencies]
bevy.workspace = true
pretty-type-name.workspace = true
Expand Down

0 comments on commit 01f0424

Please sign in to comment.