@@ -37,7 +37,7 @@ concurrency:
37
37
38
38
env :
39
39
CARGO_TERM_COLOR : always
40
- CARGO_INCREMENTAL : " 1 "
40
+ CARGO_INCREMENTAL : 0 # todo(jon): cargo-cache wipes incremental artifacts, but we eventually want to cache them
41
41
RUST_BACKTRACE : 1
42
42
rust_nightly : nightly-2024-10-20
43
43
@@ -48,11 +48,10 @@ jobs:
48
48
runs-on : ubuntu-latest
49
49
steps :
50
50
- uses : actions/checkout@v4
51
- - uses : dtolnay/rust-toolchain@stable
51
+ - uses : dtolnay/rust-toolchain@1.79.0
52
52
- uses : Swatinem/rust-cache@v2
53
53
with :
54
54
cache-all-crates : " true"
55
- cache-on-failure : " true"
56
55
# https://github.com/foresterre/cargo-msrv/blob/4345edfe3f4fc91cc8ae6c7d6804c0748fae92ae/.github/workflows/msrv.yml
57
56
- name : install_cargo_msrv
58
57
run : cargo install cargo-msrv --all-features
@@ -78,53 +77,50 @@ jobs:
78
77
swap-storage : false
79
78
- run : sudo apt-get update
80
79
- run : sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev
81
- - uses : dtolnay/rust-toolchain@stable
80
+
81
+ with :
82
+ components : rustfmt, clippy
82
83
- uses : Swatinem/rust-cache@v2
83
84
with :
84
85
cache-all-crates : " true"
85
- cache-on-failure : " true"
86
- - uses : davidB/rust-cargo-make@v1
87
86
- uses : browser-actions/setup-firefox@latest
88
-
89
- - run : cargo make tests
87
+ - run : cargo test --lib --bins --tests --examples --workspace --exclude dioxus-desktop --exclude dioxus-mobile
90
88
91
89
release-test :
92
90
if : github.event.pull_request.draft == false
93
91
name : Test Suite with Optimizations
94
92
runs-on : ubuntu-latest
95
93
steps :
96
94
- uses : actions/checkout@v4
97
- - run : sudo apt-get update
98
- - run : sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev
99
- - uses : dtolnay/rust-toolchain@stable
100
- - uses : Swatinem/rust-cache@v2
101
- with :
102
- cache-all-crates : " true"
103
- cache-on-failure : " true"
104
- - uses : davidB/rust-cargo-make@v1
105
- - uses : browser-actions/setup-firefox@latest
106
-
107
95
- name : Free Disk Space (Ubuntu)
108
96
109
97
with : # speed things up a bit
110
98
large-packages : false
111
99
docker-images : false
112
100
swap-storage : false
113
- - run : cargo test --profile release-unoptimized --lib --bins --tests --examples --workspace --exclude dioxus-desktop --exclude dioxus-mobile
101
+ - run : sudo apt-get update
102
+ - run : sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev
103
+
104
+ with :
105
+ components : rustfmt, clippy
106
+ - uses : Swatinem/rust-cache@v2
107
+ with :
108
+ cache-all-crates : " true"
109
+ - uses : browser-actions/setup-firefox@latest
110
+ - run : cargo test --lib --bins --tests --examples --workspace --exclude dioxus-desktop --exclude dioxus-mobile --profile release-unoptimized
114
111
115
112
fmt :
116
113
if : github.event.pull_request.draft == false
117
114
name : Rustfmt
118
115
runs-on : ubuntu-latest
119
116
steps :
120
117
- uses : actions/checkout@v4
121
- - uses : dtolnay/rust-toolchain@stable
118
+ - uses : dtolnay/rust-toolchain@1.79.0
122
119
with :
123
120
components : rustfmt
124
121
- uses : Swatinem/rust-cache@v2
125
122
with :
126
123
cache-all-crates : " true"
127
- cache-on-failure : " true"
128
124
- run : cargo fmt --all -- --check
129
125
130
126
typos :
@@ -151,7 +147,6 @@ jobs:
151
147
- uses : Swatinem/rust-cache@v2
152
148
with :
153
149
cache-all-crates : " true"
154
- cache-on-failure : " true"
155
150
- name : " doc --lib --all-features"
156
151
run : |
157
152
cargo doc --workspace --no-deps --all-features --document-private-items
@@ -189,11 +184,10 @@ jobs:
189
184
- uses : actions/checkout@v4
190
185
- run : sudo apt-get update
191
186
- run : sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev
192
- - uses : dtolnay/rust-toolchain@stable
187
+ - uses : dtolnay/rust-toolchain@1.79.0
193
188
- uses : Swatinem/rust-cache@v2
194
189
with :
195
190
cache-all-crates : " true"
196
- cache-on-failure : " true"
197
191
- run : cargo check --workspace --all-features --all-targets
198
192
199
193
clippy :
@@ -204,13 +198,12 @@ jobs:
204
198
- uses : actions/checkout@v4
205
199
- run : sudo apt-get update
206
200
- run : sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev
207
- - uses : dtolnay/rust-toolchain@stable
201
+ - uses : dtolnay/rust-toolchain@1.79.0
208
202
with :
209
203
components : rustfmt, clippy
210
204
- uses : Swatinem/rust-cache@v2
211
205
with :
212
206
cache-all-crates : " true"
213
- cache-on-failure : " true"
214
207
- run : cargo clippy --workspace --examples --tests --all-features --all-targets -- -D warnings
215
208
216
209
nix :
@@ -237,6 +230,12 @@ jobs:
237
230
steps :
238
231
# Do our best to cache the toolchain and node install steps
239
232
- uses : actions/checkout@v4
233
+ - name : Free Disk Space (Ubuntu)
234
+
235
+ with : # speed things up a bit
236
+ large-packages : false
237
+ docker-images : false
238
+ swap-storage : false
240
239
- uses : actions/setup-node@v4
241
240
with :
242
241
node-version : 16
@@ -248,13 +247,9 @@ jobs:
248
247
- uses : Swatinem/rust-cache@v2
249
248
with :
250
249
cache-all-crates : " true"
251
- cache-on-failure : " true"
252
- - name : Free Disk Space (Ubuntu)
253
-
254
- with : # speed things up a bit
255
- large-packages : false
256
- docker-images : false
257
- swap-storage : false
250
+ - name : Prebuild CLI
251
+ run : |
252
+ cargo build --package dioxus-cli --release
258
253
- name : Playwright
259
254
working-directory : ./packages/playwright-tests
260
255
run : |
@@ -277,14 +272,6 @@ jobs:
277
272
strategy :
278
273
matrix :
279
274
platform :
280
- - {
281
- target : x86_64-pc-windows-msvc,
282
- os : windows-latest,
283
- toolchain : " 1.79.0" ,
284
- cross : false,
285
- command : " test" ,
286
- args : " --all --tests" ,
287
- }
288
275
- {
289
276
target : aarch64-apple-darwin,
290
277
os : macos-latest,
@@ -340,19 +327,51 @@ jobs:
340
327
341
328
- name : Install cross
342
329
if : ${{ matrix.platform.cross == true }}
343
-
344
330
uses : taiki-e/install-action@cross
345
331
346
332
- uses : Swatinem/rust-cache@v2
347
333
with :
348
334
key : " matrix-${{ matrix.platform.target }}"
349
335
cache-all-crates : " true"
350
- cache-on-failure : " true"
351
336
352
337
- name : test
353
338
run : |
354
339
${{ env.RUST_CARGO_COMMAND }} ${{ matrix.platform.command }} ${{ matrix.platform.args }} --target ${{ matrix.platform.target }}
355
340
341
+ # borrowed from uv
342
+ # https://raw.githubusercontent.com/astral-sh/uv/refs/heads/main/.github/workflows/ci.yml
343
+ cargo-test-windows :
344
+ if : github.event.pull_request.draft == false
345
+ runs-on :
346
+ labels : " windows-latest"
347
+ name : " cargo test | windows"
348
+ steps :
349
+ - uses : actions/checkout@v4
350
+ - name : Create Dev Drive using ReFS
351
+ run : ${{ github.workspace }}/.github/workflows/setup-dev-drive.ps1
352
+
353
+ # actions/checkout does not let us clone into anywhere outside ${{ github.workspace }}, so we have to copy the clone...
354
+ - name : Copy Git Repo to Dev Drive
355
+ run : |
356
+ Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.UV_WORKSPACE }}" -Recurse
357
+
358
+
359
+ with :
360
+ components : rustfmt, clippy
361
+ - uses : Swatinem/rust-cache@v2
362
+ with :
363
+ workspaces : ${{ env.UV_WORKSPACE }}
364
+ cache-all-crates : " true"
365
+
366
+ - name : " Install Rust toolchain"
367
+ working-directory : ${{ env.UV_WORKSPACE }}
368
+ run : rustup show
369
+
370
+ - name : " Cargo test"
371
+ working-directory : ${{ env.UV_WORKSPACE }}
372
+ run : |
373
+ cargo test --workspace --tests
374
+
356
375
# Only run semver checks if the PR is not a draft and does not have the breaking label
357
376
# Breaking PRs don't need to follow semver since they are breaking changes
358
377
# However, this means we won't attempt to backport them, so you should be careful about using this label, as it will
@@ -369,7 +388,7 @@ jobs:
369
388
# runs-on: ubuntu-latest
370
389
# steps:
371
390
# - uses: actions/checkout@v4
372
- # - uses: dtolnay/rust-toolchain@stable
391
+ # - uses: dtolnay/rust-toolchain@1.79.0
373
392
# - uses: Swatinem/rust-cache@v2
374
393
# with:
375
394
# cache-all-crates: "true"
0 commit comments