11
11
CARGO_TERM_COLOR : always
12
12
NIGHTLY_TOOLCHAIN : nightly
13
13
14
+ concurrency :
15
+ group : ${{github.workflow}}-${{github.ref}}
16
+ cancel-in-progress : ${{github.event_name == 'pull_request'}}
17
+
14
18
jobs :
15
19
build :
16
20
strategy :
30
34
target/
31
35
key : ${{ runner.os }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }}
32
36
- uses : dtolnay/rust-toolchain@stable
33
- - name : Install alsa and udev
34
- run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
35
- if : runner.os == 'linux'
37
+ - name : Install Linux dependencies
38
+ uses : ./.github/actions/install-linux-deps
36
39
- name : Build & run tests
37
40
# See tools/ci/src/main.rs for the commands this runs
38
41
run : cargo run -p ci -- test
@@ -57,14 +60,17 @@ jobs:
57
60
- uses : dtolnay/rust-toolchain@stable
58
61
with :
59
62
components : rustfmt, clippy
60
- - name : Install alsa and udev
61
- run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
63
+ - name : Install Linux dependencies
64
+ uses : ./.github/actions/install-linux-deps
65
+ with :
66
+ wayland : true
67
+ xkb : true
62
68
- name : CI job
63
69
# See tools/ci/src/main.rs for the commands this runs
64
70
run : cargo run -p ci -- lints
65
71
66
72
miri :
67
- runs-on : ubuntu-latest
73
+ runs-on : macos-14
68
74
timeout-minutes : 60
69
75
steps :
70
76
- uses : actions/checkout@v4
81
87
with :
82
88
toolchain : ${{ env.NIGHTLY_TOOLCHAIN }}
83
89
components : miri
84
- - name : Install alsa and udev
85
- run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
86
90
- name : CI job
87
91
# To run the tests one item at a time for troubleshooting, use
88
92
# cargo --quiet test --lib -- --list | sed 's/: test$//' | MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-permissive-provenance -Zmiri-disable-weak-memory-emulation" xargs -n1 cargo miri test -p bevy_ecs --lib -- --exact
@@ -116,8 +120,8 @@ jobs:
116
120
- uses : dtolnay/rust-toolchain@stable
117
121
with :
118
122
toolchain : stable
119
- - name : Install alsa and udev
120
- run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
123
+ - name : Install Linux dependencies
124
+ uses : ./.github/actions/ install-linux-deps
121
125
- name : Check Compile
122
126
# See tools/ci/src/main.rs for the commands this runs
123
127
run : cargo run -p ci -- compile
@@ -142,8 +146,31 @@ jobs:
142
146
target : wasm32-unknown-unknown
143
147
- name : Check wasm
144
148
run : cargo check --target wasm32-unknown-unknown
149
+
150
+ build-wasm-atomics :
151
+ runs-on : ubuntu-latest
152
+ timeout-minutes : 30
153
+ needs : build
154
+ steps :
155
+ - uses : actions/checkout@v4
156
+ - uses : actions/cache@v4
157
+ with :
158
+ path : |
159
+ ~/.cargo/bin/
160
+ ~/.cargo/registry/index/
161
+ ~/.cargo/registry/cache/
162
+ ~/.cargo/git/db/
163
+ target/
164
+ key : ubuntu-assets-cargo-build-wasm-nightly-${{ hashFiles('**/Cargo.toml') }}
165
+ - uses : dtolnay/rust-toolchain@master
166
+ with :
167
+ toolchain : ${{ env.NIGHTLY_TOOLCHAIN }}
168
+ targets : wasm32-unknown-unknown
169
+ components : rust-src
170
+ - name : Check wasm
171
+ run : cargo check --target wasm32-unknown-unknown -Z build-std=std,panic_abort
145
172
env :
146
- RUSTFLAGS : --cfg=web_sys_unstable_apis
173
+ RUSTFLAGS : " -C target-feature=+atomics,+bulk-memory "
147
174
148
175
markdownlint :
149
176
runs-on : ubuntu-latest
@@ -183,40 +210,66 @@ jobs:
183
210
echo 'Or if you use VSCode, use the `Even Better Toml` extension with 2 spaces'
184
211
echo 'You can find the extension here: https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml'
185
212
186
-
187
- run-examples-on-windows-dx12 :
188
- runs-on : windows-latest
189
- timeout-minutes : 60
213
+ typos :
214
+ runs-on : ubuntu-latest
215
+ timeout-minutes : 30
190
216
steps :
191
217
- uses : actions/checkout@v4
218
+ - name : Check for typos
219
+
220
+ - name : Typos info
221
+ if : failure()
222
+ run : |
223
+ echo 'To fix typos, please run `typos -w`'
224
+ echo 'To check for a diff, run `typos`'
225
+ echo 'You can find typos here: https://crates.io/crates/typos'
226
+ echo 'if you use VSCode, you can also install `Typos Spell Checker'
227
+ echo 'You can find the extension here: https://marketplace.visualstudio.com/items?itemName=tekumara.typos-vscode'
192
228
193
- - uses : dtolnay/rust-toolchain@stable
194
-
195
- - uses : actions/cache@v4
196
- with :
197
- path : |
198
- ~/.cargo/bin/
199
- ~/.cargo/registry/index/
200
- ~/.cargo/registry/cache/
201
- ~/.cargo/git/db/
202
- target/
203
- key : ${{ runner.os }}-windows-run-examples-${{ hashFiles('**/Cargo.toml') }}
204
229
230
+ run-examples-macos-metal :
231
+ runs-on : macos-14
232
+ timeout-minutes : 30
233
+ steps :
234
+ - uses : actions/checkout@v4
235
+ - uses : dtolnay/rust-toolchain@stable
236
+ - name : Disable audio
237
+ # Disable audio through a patch. on github m1 runners, audio timeouts after 15 minutes
238
+ run : git apply --ignore-whitespace tools/example-showcase/disable-audio.patch
205
239
- name : Build bevy
206
- shell : bash
207
240
# this uses the same command as when running the example to ensure build is reused
208
241
run : |
209
- WGPU_BACKEND=dx12 CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing"
210
-
242
+ TRACE_CHROME=trace-alien_cake_addict.json CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing,trace,trace_chrome"
211
243
- name : Run examples
212
- shell : bash
213
244
run : |
214
245
for example in .github/example-run/*.ron; do
215
246
example_name=`basename $example .ron`
247
+ echo -n $example_name > last_example_run
216
248
echo "running $example_name - "`date`
217
- time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing"
249
+ time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome "
218
250
sleep 10
251
+ if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
252
+ mkdir screenshots-$example_name
253
+ mv screenshot-*.png screenshots-$example_name/
254
+ fi
219
255
done
256
+ mkdir traces && mv trace*.json traces/
257
+ mkdir screenshots && mv screenshots-* screenshots/
258
+ - name : save traces
259
+ uses : actions/upload-artifact@v4
260
+ with :
261
+ name : example-traces-macos
262
+ path : traces
263
+ - name : save screenshots
264
+ uses : actions/upload-artifact@v4
265
+ with :
266
+ name : screenshots-macos
267
+ path : screenshots
268
+ - uses : actions/upload-artifact@v4
269
+ if : ${{ failure() && github.event_name == 'pull_request' }}
270
+ with :
271
+ name : example-run-macos
272
+ path : example-run/
220
273
221
274
check-doc :
222
275
runs-on : ubuntu-latest
@@ -233,9 +286,11 @@ jobs:
233
286
target/
234
287
key : ${{ runner.os }}-check-doc-${{ hashFiles('**/Cargo.toml') }}
235
288
- uses : dtolnay/rust-toolchain@stable
236
- - name : Install alsa and udev
237
- run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
238
- if : runner.os == 'linux'
289
+ - name : Install Linux dependencies
290
+ uses : ./.github/actions/install-linux-deps
291
+ with :
292
+ wayland : true
293
+ xkb : true
239
294
- name : Build and check doc
240
295
# See tools/ci/src/main.rs for the commands this runs
241
296
run : cargo run -p ci -- doc
@@ -339,8 +394,8 @@ jobs:
339
394
- uses : dtolnay/rust-toolchain@master
340
395
with :
341
396
toolchain : ${{ env.MSRV }}
342
- - name : Install alsa and udev
343
- run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
397
+ - name : Install Linux dependencies
398
+ uses : ./.github/actions/ install-linux-deps
344
399
- name : Run cargo check
345
400
id : check
346
401
run : cargo check
@@ -375,4 +430,29 @@ jobs:
375
430
echo " Fix the issue by replacing 'bevy_internal' with 'bevy'"
376
431
echo " Example: 'use bevy::sprite::MaterialMesh2dBundle;' instead of 'bevy_internal::sprite::MaterialMesh2dBundle;'"
377
432
exit 1
378
- fi
433
+ fi
434
+ check-cfg :
435
+ runs-on : ubuntu-latest
436
+ timeout-minutes : 30
437
+ steps :
438
+ - uses : actions/checkout@v4
439
+ - uses : actions/cache@v4
440
+ with :
441
+ path : |
442
+ ~/.cargo/bin/
443
+ ~/.cargo/registry/index/
444
+ ~/.cargo/registry/cache/
445
+ ~/.cargo/git/db/
446
+ target/
447
+ key : ${{ runner.os }}-check-doc-${{ hashFiles('**/Cargo.toml') }}
448
+ - uses : dtolnay/rust-toolchain@master
449
+ with :
450
+ toolchain : ${{ env.NIGHTLY_TOOLCHAIN }}
451
+ - name : Install Linux dependencies
452
+ uses : ./.github/actions/install-linux-deps
453
+ with :
454
+ wayland : true
455
+ xkb : true
456
+ - name : Build and check cfg typos
457
+ # See tools/ci/src/main.rs for the commands this runs
458
+ run : cargo run -p ci -- cfg-check
0 commit comments