-
Notifications
You must be signed in to change notification settings - Fork 78
301 lines (292 loc) Β· 11.3 KB
/
ci.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
name: CI
on:
# Run on pull requests (PR)
pull_request:
types:
# New PR
- opened
# Change pushed to source branch
- synchronize
# PR reopened
- reopened
# PR converted from Draft to Ready For Review
- ready_for_review
# Run on any new change on the main branch (CI)
push:
branches:
- main
- hotfix/*
# Enable manual trigger via GitHub UI
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
dimensions: [2d, 3d, all]
os: [windows-latest, ubuntu-latest, macos-14]
runs-on: ${{ matrix.os }}
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;
if: runner.os == 'linux'
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-build-${{ matrix.dimensions }}-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Build & run lib tests (${{ matrix.dimensions }} no GPU)
run: cargo test --lib --no-default-features --features ${{ matrix.dimensions }} --features serde
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'linux' && matrix.dimensions != 'all'
- name: Build & run lib tests (${{ matrix.dimensions }} DX12)
shell: bash
run: WGPU_BACKEND=dx12 cargo test --lib --no-default-features --features ${{ matrix.dimensions }} --features serde,gpu_tests
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'windows' && matrix.dimensions != 'all'
- name: Build & run all tests (${{ matrix.dimensions }} METAL)
shell: bash
run: WGPU_BACKEND=metal cargo test --no-default-features --features ${{ matrix.dimensions }} --features serde,gpu_tests
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'macos' && matrix.dimensions != 'all'
- name: Build & run lib tests (all no GPU)
run: cargo test --lib --no-default-features --features "2d 3d serde"
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'linux' && matrix.dimensions == 'all'
- name: Build & run lib tests (all DX12)
shell: bash
run: WGPU_BACKEND=dx12 cargo test --lib --no-default-features --features "2d 3d serde gpu_tests"
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'windows' && matrix.dimensions == 'all'
- name: Build & run all tests (all METAL)
shell: bash
run: WGPU_BACKEND=metal cargo test --no-default-features --features "2d 3d serde gpu_tests"
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'macos' && matrix.dimensions == 'all'
build-wasm:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ubuntu-cargo-build-wasm-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-unknown-unknown
- name: Check wasm
run: cargo check --target wasm32-unknown-unknown --no-default-features --features 2d,3d
msrv:
runs-on: ubuntu-latest
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;
if: runner.os == 'linux'
- uses: actions/checkout@v4
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-build-msrv-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.79
components: rustfmt, clippy
- name: Check
run: cargo check --lib --all-features
env:
CARGO_INCREMENTAL: 0
run-examples:
#runs-on: ubuntu-latest # Bug: Library libxkbcommon-x11.so could not be loaded.
runs-on: windows-latest
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;
if: runner.os == 'linux'
# - name: Install graphic drivers
# run: |
# sudo apt-get update -y -qq
# sudo add-apt-repository ppa:kisak/kisak-mesa -y
# sudo apt-get update
# sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
# if: runner.os == 'linux'
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-build-all-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Build & run examples (Linux)
run: |
for example in .github/example-run/3d/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_pbr bevy/bevy_ui bevy/default_font 3d serde bevy/bevy_ci_testing"
sleep 10
done
for example in .github/example-run/3dpng/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_pbr bevy/bevy_ui bevy/default_font bevy/png 3d serde bevy/bevy_ci_testing"
sleep 10
done
for example in .github/example-run/2d/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_sprite bevy/bevy_ui bevy/default_font 2d serde bevy/bevy_ci_testing"
sleep 10
done
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'linux'
- name: Build & run examples (Windows)
shell: bash
run: |
for example in .github/example-run/3d/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_pbr bevy/bevy_ui bevy/default_font 3d serde bevy/bevy_ci_testing"
sleep 10
done
for example in .github/example-run/3dpng/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_pbr bevy/bevy_ui bevy/default_font bevy/png 3d serde bevy/bevy_ci_testing"
sleep 10
done
for example in .github/example-run/2d/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --no-default-features --features="bevy/bevy_winit bevy/bevy_sprite bevy/bevy_ui bevy/default_font 2d serde bevy/bevy_ci_testing"
sleep 10
done
env:
CARGO_INCREMENTAL: 0
if: runner.os == 'windows'
check-format:
name: Check format
runs-on: ubuntu-latest
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;
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-build-all-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Check format
run: cargo fmt --all -- --check
env:
CARGO_INCREMENTAL: 0
- name: Check lints
run: cargo clippy --workspace --all-targets --all-features -- -Dwarnings
env:
CARGO_INCREMENTAL: 0
coverage:
name: Coverage
#runs-on: ubuntu-latest
runs-on: macos-14
permissions:
actions: read
checks: write
steps:
# - name: Install Bevy dependencies
# run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
# if: runner.os == 'linux'
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ runner.os }}-cargo-build-all-stable-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
# - name: Install graphic drivers
# run: |
# sudo apt-get update -y -qq
# sudo add-apt-repository ppa:kisak/kisak-mesa -y
# sudo apt-get update
# sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
# if: runner.os == 'linux'
- name: Install cargo-tarpaulin
run: |
RUST_BACKTRACE=1 cargo install --version 0.31.2 cargo-tarpaulin
- name: Generate code coverage
run: |
RUST_BACKTRACE=1 cargo tarpaulin --engine llvm --verbose --timeout 120 --out Lcov --workspace --all-features
ls -la
- name: Upload code coverage
uses: coverallsapp/github-action@master
with:
path-to-lcov: 'lcov.info'
github-token: ${{ secrets.GITHUB_TOKEN }}