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
# CI for bevy_elements (canonical repository).
name: CI
on:
push:
branches:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: build (standalone) + test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Bevy build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
- 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 --release
# Includes `tests/leaf.rs`, the boundary ratchet. GPU tests are `#[ignore = "needs a GPU"]` and
# never run here.
- name: Test
run: cargo test
- name: Build examples
run: cargo build --examples --all-features
lint:
name: fmt + clippy + doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Bevy build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
- 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
runs-on: ubuntu-latest
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