1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# CI for bevy_elements (canonical repository).
name: CI
on:
push:
branches:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: build (standalone) + test
needs: lint
runs-on:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
# **The load-bearing step, and it is `build` rather than `test` deliberately.**
#
# `cargo test` compiles dev-dependencies, and this crate's dev-dependency is the FULL `bevy`
# umbrella — the examples need a window and a camera, while the crate itself is trimmed to the
# features it names. Cargo unifies features across a build, so under `cargo test` the crate
# silently receives every Bevy feature there is, and a hole in its own `[dependencies]` feature
# list cannot fail.
#
# The sibling crate `bevy_autogib` shipped exactly that hole: it named a type behind a feature it
# never declared, every test passed, and the published crate did not compile for anyone. A plain
# `cargo build` takes no dev-dependencies, so it compiles what a consumer actually gets.
- name: Build with only the declared features
run: cargo build
# Includes `tests/leaf.rs`, the boundary ratchet. GPU tests are `#[ignore = "needs a GPU"]` and
# never run here. The `isomesh` feature's crate compiles with the published isomesh 0.0.11:
# its module and the `voxel_snow` example are feature-gated, so a plain `cargo test` skips
# them and every voxel test would only ever run on a feature-enabled machine.
- name: Test
run: cargo test
- name: Test the isomesh feature
run: cargo test --features=isomesh --lib
# Debug-info debugprofile links of a Bevy example ran the runner out of memory:
# `ld terminated with signal 7 [Bus error]` (bevy_isomesh made the same failure
# visible at 2 GB of debuginfo per example). Examples only have to load; debuginfo
# is turned off through the dev profile (`CARGO_PROFILE_DEV_DEBUG`) for this build
# alone, not through `RUSTFLAGS`, which would invalidate every fingerprint in the
# runner's persistent target dir.
- name: Build examples
run: cargo build --examples --all-features
env:
CARGO_PROFILE_DEV_DEBUG: "0"
lint:
name: fmt + clippy + doc
runs-on:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- run: cargo fmt --check
- run: cargo clippy --all-targets --all-features -- -D warnings
- run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: -D warnings
wasm:
name: wasm32 (WebGPU) library build
needs: lint
runs-on:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: rustup target add wasm32-unknown-unknown
- run: cargo build --lib --target wasm32-unknown-unknown