@@ -24,28 +24,52 @@ jobs:
24
24
runs-on : ${{ matrix.os }}
25
25
steps :
26
26
- uses : actions/checkout@v2
27
-
27
+ - uses : actions/cache@v2
28
+ with :
29
+ path : |
30
+ ~/.cargo/bin/
31
+ ~/.cargo/registry/index/
32
+ ~/.cargo/registry/cache/
33
+ ~/.cargo/git/db/
34
+ target/
35
+ key : ${{ runner.os }}-cargo-build-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }}
28
36
- uses : actions-rs/toolchain@v1
29
37
with :
30
38
toolchain : ${{ matrix.toolchain }}
31
- components : rustfmt, clippy
32
39
override : true
33
-
34
40
- name : Install alsa and udev
35
41
run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
36
42
if : runner.os == 'linux'
37
-
38
- - name : Check the format
39
- # See tools/ci/src/main.rs for the commands this runs
40
- run : cargo run -p ci
41
- if : runner.os == 'linux' && matrix.toolchain == 'stable'
42
-
43
43
- name : Build & run tests
44
44
run : cargo test --workspace
45
45
env :
46
46
CARGO_INCREMENTAL : 0
47
47
RUSTFLAGS : " -C debuginfo=0 -D warnings"
48
48
49
+ ci :
50
+ runs-on : ubuntu-latest
51
+ steps :
52
+ - uses : actions/checkout@v2
53
+ - uses : actions/cache@v2
54
+ with :
55
+ path : |
56
+ ~/.cargo/bin/
57
+ ~/.cargo/registry/index/
58
+ ~/.cargo/registry/cache/
59
+ ~/.cargo/git/db/
60
+ target/
61
+ key : ${{ runner.os }}-cargo-ci-${{ hashFiles('**/Cargo.toml') }}
62
+ - uses : actions-rs/toolchain@v1
63
+ with :
64
+ toolchain : stable
65
+ components : rustfmt, clippy
66
+ override : true
67
+ - name : Install alsa and udev
68
+ run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
69
+ - name : CI job
70
+ # See tools/ci/src/main.rs for the commands this runs
71
+ run : cargo run -p ci
72
+
49
73
build-wasm :
50
74
strategy :
51
75
matrix :
@@ -54,13 +78,20 @@ jobs:
54
78
runs-on : ${{ matrix.os }}
55
79
steps :
56
80
- uses : actions/checkout@v2
57
-
81
+ - uses : actions/cache@v2
82
+ with :
83
+ path : |
84
+ ~/.cargo/bin/
85
+ ~/.cargo/registry/index/
86
+ ~/.cargo/registry/cache/
87
+ ~/.cargo/git/db/
88
+ target/
89
+ key : ${{ runner.os }}-cargo-build-wasm-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }}
58
90
- uses : actions-rs/toolchain@v1
59
91
with :
60
92
toolchain : ${{ matrix.toolchain }}
61
93
target : wasm32-unknown-unknown
62
94
override : true
63
-
64
95
- name : Check wasm
65
96
uses : actions-rs/cargo@v1
66
97
with :
@@ -71,23 +102,33 @@ jobs:
71
102
runs-on : ubuntu-latest
72
103
steps :
73
104
- uses : actions/checkout@v2
105
+ - uses : actions/cache@v2
106
+ with :
107
+ path : |
108
+ ~/.cargo/bin/
109
+ ~/.cargo/registry/index/
110
+ ~/.cargo/registry/cache/
111
+ ~/.cargo/git/db/
112
+ target/
113
+ key : ${{ runner.os }}-cargo-build-android-${{ hashFiles('**/Cargo.toml') }}
74
114
- name : Uninstall android-31
75
115
run : $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --uninstall "platforms;android-31"
76
116
- name : Install Android targets
77
117
run : rustup target add aarch64-linux-android armv7-linux-androideabi
78
118
- name : Install Cargo APK
79
- run : cargo install cargo-apk
119
+ run : cargo install --force cargo-apk
80
120
- name : Build APK
81
121
run : cargo apk build --example android
82
122
83
123
markdownlint :
84
124
runs-on : ubuntu-latest
125
+ needs : check-missing-examples-in-docs
126
+ if : always()
85
127
steps :
86
128
- uses : actions/checkout@v2
87
129
with :
88
130
# Full git history is needed to get a proper list of changed files within `super-linter`
89
131
fetch-depth : 0
90
-
91
132
- name : Run Markdown Lint
92
133
uses : docker://ghcr.io/github/super-linter:slim-v4
93
134
env :
@@ -99,41 +140,83 @@ jobs:
99
140
100
141
check-markdown-links :
101
142
runs-on : ubuntu-latest
143
+ needs : markdownlint
144
+ if : always()
102
145
steps :
103
146
- uses : actions/checkout@v2
104
- - uses : gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976
147
+ - name : check dead links
148
+ continue-on-error : true
149
+ id : run1
150
+ uses : gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976
151
+ with :
152
+ use-quiet-mode : ' yes'
153
+ use-verbose-mode : ' yes'
154
+ config-file : ' .github/linters/markdown-link-check.json'
155
+ - name : Sleep for 30 seconds
156
+ if : steps.run1.outcome=='failure'
157
+ run : sleep 30s
158
+ shell : bash
159
+ - name : check dead links (retry)
160
+ continue-on-error : true
161
+ id : run2
162
+ if : steps.run1.outcome=='failure'
163
+ uses : gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976
164
+ with :
165
+ use-quiet-mode : ' yes'
166
+ use-verbose-mode : ' yes'
167
+ config-file : ' .github/linters/markdown-link-check.json'
168
+ - name : Sleep for 30 seconds
169
+ if : steps.run2.outcome=='failure'
170
+ run : sleep 30s
171
+ shell : bash
172
+ - name : check dead links (retry 2)
173
+ continue-on-error : true
174
+ id : run3
175
+ if : steps.run2.outcome=='failure'
176
+ uses : gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976
105
177
with :
106
178
use-quiet-mode : ' yes'
107
179
use-verbose-mode : ' yes'
108
180
config-file : ' .github/linters/markdown-link-check.json'
181
+ - name : set the status
182
+ if : always()
183
+ run : |
184
+ if ${{ steps.run1.outcome=='success' || steps.run2.outcome=='success' || steps.run3.outcome=='success' }}; then
185
+ echo success
186
+ else
187
+ exit 1
188
+ fi
109
189
110
190
run-examples :
111
191
runs-on : ubuntu-latest
112
-
113
192
steps :
114
193
- name : Install dependencies
115
194
run : |
116
195
sudo apt-get update;
117
196
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
118
197
libasound2-dev libudev-dev wget unzip xvfb;
119
-
120
198
- uses : actions/checkout@v2
121
-
199
+ - uses : actions/cache@v2
200
+ with :
201
+ path : |
202
+ ~/.cargo/bin/
203
+ ~/.cargo/registry/index/
204
+ ~/.cargo/registry/cache/
205
+ ~/.cargo/git/db/
206
+ target/
207
+ key : ${{ runner.os }}-cargo-run-examples-${{ hashFiles('**/Cargo.toml') }}
122
208
- uses : actions-rs/toolchain@v1
123
209
with :
124
210
toolchain : stable
125
-
126
211
- name : Setup swiftshader
127
212
run : |
128
213
wget https://github.com/qarmin/gtk_library_store/releases/download/3.24.0/swiftshader.zip;
129
214
unzip swiftshader.zip;
130
215
curr="$(pwd)/libvk_swiftshader.so";
131
216
sed -i "s|PATH_TO_CHANGE|$curr|" vk_swiftshader_icd.json;
132
-
133
217
- name : Build bevy
134
218
run : |
135
219
cargo build --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_wgpu,bevy_winit,render,png,hdr,x11,bevy_ci_testing"
136
-
137
220
- name : Run examples
138
221
run : |
139
222
for example in .github/example-run/*.ron; do
@@ -145,19 +228,21 @@ jobs:
145
228
146
229
check-doc :
147
230
runs-on : ubuntu-latest
231
+ needs : check-markdown-links
232
+ if : always()
148
233
steps :
149
234
- uses : actions/checkout@v2
150
235
- name : Install alsa and udev
151
236
run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
152
237
if : runner.os == 'linux'
153
238
- name : Installs cargo-deadlinks
154
- run : cargo install cargo-deadlinks
239
+ run : cargo install --force cargo-deadlinks
155
240
- name : Build and check doc
156
241
run : RUSTDOCFLAGS='-D warnings' cargo doc --all-features --no-deps
157
242
- name : Checks dead links
158
243
run : cargo deadlinks --dir target/doc/bevy
159
244
continue-on-error : true
160
-
245
+
161
246
check-missing-examples-in-docs :
162
247
runs-on : ubuntu-latest
163
248
steps :
@@ -175,17 +260,22 @@ jobs:
175
260
runs-on : ubuntu-latest
176
261
steps :
177
262
- uses : actions/checkout@v2
178
-
263
+ - uses : actions/cache@v2
264
+ with :
265
+ path : |
266
+ ~/.cargo/bin/
267
+ ~/.cargo/registry/index/
268
+ ~/.cargo/registry/cache/
269
+ ~/.cargo/git/db/
270
+ target/
271
+ key : ${{ runner.os }}-cargo-check-unused-dependencies-${{ hashFiles('**/Cargo.toml') }}
179
272
- uses : actions-rs/toolchain@v1
180
273
with :
181
274
toolchain : nightly
182
275
override : true
183
-
184
276
- name : Installs cargo-udeps
185
- run : cargo install cargo-udeps
186
-
277
+ run : cargo install --force cargo-udeps
187
278
- name : Install alsa and udev
188
279
run : sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
189
-
190
280
- name : Run cargo udeps
191
281
run : cargo udeps
0 commit comments