-
-
Notifications
You must be signed in to change notification settings - Fork 62
234 lines (183 loc) · 7.02 KB
/
Copy pathci.yaml
File metadata and controls
234 lines (183 loc) · 7.02 KB
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
# Use the same Rust toolchain across jobs so they can share a cache.
toolchain: nightly-2026-01-22
jobs:
# Run tests.
test:
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
components: rustc-codegen-cranelift-preview
toolchain: ${{ env.toolchain }}
- name: Set LD_LIBRARY_PATH
id: ld_library_path
run: |
# Setting LD_LIBRARY_PATH is a workaround for <https://github.com/TheBevyFlock/bevy_new_2d/pull/318#issuecomment-2585935350>.
echo "LD_LIBRARY_PATH=$(rustc --print target-libdir)" >> $GITHUB_ENV
- name: Populate target directory from cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-directories: ${{ env.LD_LIBRARY_PATH }}
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev
- name: Active CI cargo config
run: mv .cargo/config_ci.toml .cargo/config.toml
- name: Install cargo binstall
uses: cargo-bins/cargo-binstall@main
- name: Install Wild
run: cargo binstall wild-linker --locked --force
- name: Install nextest
run: cargo binstall cargo-nextest --locked --force
- name: Run tests
run: cargo nextest run --locked --workspace --all-targets --no-fail-fast --no-tests warn
# Running doc tests separately is a workaround for <https://github.com/rust-lang/cargo/issues/6669>.
- name: Run doctests
run: cargo test --locked --workspace --doc
# Failing until we have a `lib.rs` again
continue-on-error: true
# Check that the game builds for web.
build-web:
name: Check build for web
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
targets: wasm32-unknown-unknown
toolchain: ${{ env.toolchain }}
- name: Active CI cargo config
run: mv .cargo/config_ci.toml .cargo/config.toml
- name: Install cargo binstall
uses: cargo-bins/cargo-binstall@main
- name: Install Wild
run: cargo binstall wild-linker --locked --force
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev
- name: Populate target directory from cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Check build for web
run: cargo check --config 'profile.web.inherits="dev"' --features dev,web --no-default-features --profile web --target wasm32-unknown-unknown
# Run clippy lints.
clippy:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
components: clippy, rustc-codegen-cranelift-preview
toolchain: ${{ env.toolchain }}
- name: Active CI cargo config
run: mv .cargo/config_ci.toml .cargo/config.toml
- name: Install cargo binstall
uses: cargo-bins/cargo-binstall@main
- name: Install Wild
run: cargo binstall wild-linker --locked --force
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev
- name: Populate target directory from cache
uses: Swatinem/rust-cache@v2
with:
save-if: false
shared-key: lints
- name: Run clippy lints
run: cargo clippy --locked --workspace --all-targets -- --deny warnings
# Check formatting.
format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
components: rustfmt
toolchain: ${{ env.toolchain }}
- name: Run cargo fmt
run: cargo fmt --all -- --check
# Check documentation.
doc:
name: Docs
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
components: rustc-codegen-cranelift-preview
toolchain: ${{ env.toolchain }}
- name: Active CI cargo config
run: mv .cargo/config_ci.toml .cargo/config.toml
- name: Install cargo binstall
uses: cargo-bins/cargo-binstall@main
- name: Install Wild
run: cargo binstall wild-linker --locked --force
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev
- name: Populate target directory from cache
uses: Swatinem/rust-cache@v2
with:
save-if: false
shared-key: lints
- name: Check documentation
run: cargo doc --locked --workspace --document-private-items --no-deps
# Run Bevy lints.
bevy-lint:
name: Bevy linter
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
components: rustc-codegen-cranelift-preview, rustc-dev, llvm-tools-preview
toolchain: ${{ env.toolchain }}
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev
- name: Populate target directory from cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
shared-key: lints
- name: Install Bevy linter
run: cargo install --git=https://github.com/TheBevyFlock/bevy_cli --locked bevy_lint --all-features
- name: Add cranelift to rustc
run: rustup component add rustc-codegen-cranelift-preview --toolchain ${{ env.toolchain }}
- name: Active CI cargo config
run: mv .cargo/config_ci.toml .cargo/config.toml
- name: Install cargo binstall
uses: cargo-bins/cargo-binstall@main
- name: Install Wild
run: cargo binstall wild-linker --locked --force
- name: Run Bevy linter
run: bevy_lint --locked --workspace --all-targets