-
Notifications
You must be signed in to change notification settings - Fork 50
77 lines (73 loc) · 2.77 KB
/
examples.yaml
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
name: example-run
on:
pull_request:
branches:
- main
- "v*"
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
NIGHTLY_TOOLCHAIN: nightly
jobs:
run-platformer-example-windows:
runs-on: windows-latest
timeout-minutes: 30
steps:
- name: Install Bevy dependencies
run: |
sudo apt-get update;
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
libasound2-dev libudev-dev libxkbcommon-x11-0 libwayland-dev;
- name: install xvfb, llvmpipe and lavapipe
run: |
sudo apt-get update -y -qq
sudo add-apt-repository ppa:kisak/turtle -y
sudo apt-get update
sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-run-examples-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
- name: Build bevy
shell: bash
# this uses the same command as when running the example to ensure build is reused
run: |
WGPU_BACKEND=dx12 TRACE_CHROME=trace-platformer.json CI_TESTING_CONFIG=.github/example-run/data.ron cargo build --release --example platformer --features "bevy_xpbd_3d,bevy/bevy_ci_testing,bevy/trace_chrome,bevy/trace"
- name: Run examples
shell: bash
run: |
example_name=`basename plaformer.ron`
echo -n $example_name > last_example_run
echo "running platformer - "`date`
time WGPU_BACKEND=dx12 TRACE_CHROME=trace-platformer.json CI_TESTING_CONFIG=.github/example-run/data.ron xvfb-run cargo run --release --example platformer --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-platformer
mv screenshot-*.png screenshots-platformer/
fi
mkdir traces && mv trace*.json traces/
mkdir screenshots && mv screenshots-* screenshots/
- name: save traces
uses: actions/upload-artifact@v4
with:
name: example-traces-windows
path: traces
- name: save screenshots
uses: actions/upload-artifact@v4
with:
name: screenshots-windows
path: screenshots
- uses: actions/upload-artifact@v4
if: ${{ failure() && github.event_name == 'pull_request' }}
with:
name: example-run-windows
path: example-run/