4
4
- main
5
5
pull_request :
6
6
branches :
7
- - ' ** '
7
+ - " ** "
8
8
9
9
name : CI
10
10
@@ -15,32 +15,32 @@ jobs:
15
15
timeout-minutes : 10
16
16
steps :
17
17
- uses : actions/checkout@v4
18
- - uses : actions-rust-lang/audit@v1
19
- name : Audit Rust Dependencies
18
+ - name : " Generate Cargo.lock"
19
+ run : cargo generate-lockfile
20
+ - uses : rustsec/audit-check@v2
20
21
with :
21
- denyWarnings : true
22
- createIssues : false
22
+ token : ${{ secrets.GITHUB_TOKEN }}
23
23
24
24
licenses :
25
25
name : Licenses
26
26
runs-on : ubuntu-latest
27
27
steps :
28
- - uses : actions/checkout@v4
29
- - uses : EmbarkStudios/cargo-deny-action@v2
28
+ - uses : actions/checkout@v4
29
+ - uses : EmbarkStudios/cargo-deny-action@v2
30
30
31
- - name : cargo-about cache
32
- id : cargo-about-cache
33
- uses : actions/cache@v4
34
- with :
35
- path : ~/.cargo/bin/cargo-about
36
- key : cargo-about-${{ runner.os }}
31
+ - name : cargo-about cache
32
+ id : cargo-about-cache
33
+ uses : actions/cache@v4
34
+ with :
35
+ path : ~/.cargo/bin/cargo-about
36
+ key : cargo-about-${{ runner.os }}
37
37
38
- - name : cargo-about install
39
- if : steps.cargo-about-cache.outputs.cache-hit != 'true'
40
- run : cargo install --locked cargo-about
38
+ - name : cargo-about install
39
+ if : steps.cargo-about-cache.outputs.cache-hit != 'true'
40
+ run : cargo install --locked cargo-about
41
41
42
- - name : cargo-about generate licenses
43
- run : cargo about generate --workspace --features "server_side_graphviz" about.hbs > doc/src/licenses.html
42
+ - name : cargo-about generate licenses
43
+ run : cargo about generate --workspace about.hbs > doc/src/licenses.html
44
44
45
45
fmt :
46
46
name : Rustfmt
@@ -82,14 +82,14 @@ jobs:
82
82
toolchain : nightly
83
83
components : clippy
84
84
85
- - name : ' Run clippy (client side graphviz)'
85
+ - name : " Run clippy (client side graphviz)"
86
86
run : |
87
87
cargo clippy --workspace -- -D warnings
88
88
89
- - name : ' Run clippy (server side graphviz)'
89
+ - name : " Run clippy (server side graphviz)"
90
90
# we cannot use `--all-features` because `dot_ix` has features that are mutually exclusive.
91
91
run : |
92
- cargo clippy --workspace --features "server_side_graphviz" -- -D warnings
92
+ cargo clippy --workspace -- -D warnings
93
93
94
94
coverage :
95
95
name : Coverage
@@ -104,14 +104,14 @@ jobs:
104
104
105
105
- uses : taiki-e/install-action@cargo-llvm-cov
106
106
107
- - name : ' Collect coverage'
107
+ - name : " Collect coverage"
108
108
run : ./coverage.sh
109
109
110
- - name : ' Print directory sizes'
110
+ - name : " Print directory sizes"
111
111
run : du -sh target/coverage target/llvm-cov-target
112
112
113
113
- name : Upload to codecov.io
114
- uses : codecov/codecov-action@v4
114
+ uses : codecov/codecov-action@v5
115
115
with :
116
116
files : ./target/coverage/lcov.info
117
117
token : ${{ secrets.CODECOV_TOKEN }}
@@ -124,11 +124,11 @@ jobs:
124
124
- uses : actions/checkout@v4
125
125
- uses : dtolnay/rust-toolchain@stable
126
126
127
- - name : ' Build and test'
127
+ - name : " Build and test"
128
128
run : cargo test --workspace
129
129
130
- build_playground_linux :
131
- name : Build Playground (Linux)
130
+ build_playground_linux_leptos :
131
+ name : Build Playground (Linux) - cargo-leptos
132
132
# On `ubuntu-latest`, this job fails because the CI runner is CPU bound
133
133
# when `monaco` is built.
134
134
#
@@ -137,32 +137,82 @@ jobs:
137
137
# See <https://github.com/actions/runner-images/issues/6680>
138
138
runs-on : ubuntu-22.04
139
139
timeout-minutes : 25
140
+ env :
141
+ # Seems to solve this issue:
142
+ #
143
+ # ```text
144
+ # 0: Unexpected token Semicolon at :1360:9
145
+ # ```
146
+ LEPTOS_TAILWIND_VERSION : " v4.1.4"
140
147
steps :
141
148
- uses : actions/checkout@v4
142
- - name : ' Install Rust'
149
+ - name : " Install Rust"
143
150
uses : dtolnay/rust-toolchain@master
144
151
with :
145
152
toolchain : stable
146
153
targets : wasm32-unknown-unknown
147
154
148
- - name : cargo-leptos cache
149
- id : cargo-leptos-cache
150
- uses : actions/cache@v4
155
+ - name : cargo-leptos cache restore
156
+ id : cargo_leptos_cache_restore
157
+ uses : actions/cache/restore @v4
151
158
with :
152
159
path : ~/.cargo/bin/cargo-leptos
153
- key : cargo-leptos-${{ runner.os }}
160
+ key : ${{ runner.os }}-cargo-leptos
161
+
162
+ - run : cargo install cargo-leptos
163
+ if : steps.cargo_leptos_cache_restore.outputs.cache-hit != 'true'
154
164
155
- - name : cargo-leptos install
156
- if : steps.cargo-leptos-cache.outputs.cache-hit != 'true'
157
- run : cargo install cargo-leptos
165
+ - name : cargo-leptos cache save
166
+ id : cargo_leptos_cache_save
167
+ uses : actions/cache/save@v4
168
+ if : always() && steps.cargo_leptos_cache_restore.outputs.cache-hit != 'true'
169
+ with :
170
+ path : ~/.cargo/bin/cargo-leptos
171
+ key : ${{ runner.os }}-cargo-leptos
158
172
159
- - name : ' Build playground'
173
+ - name : " Build playground"
160
174
working-directory : ./playground
161
175
run : cargo leptos build -v
162
176
163
- - name : ' Build playground (server side graphviz)'
177
+ build_playground_linux_trunk :
178
+ name : Build Playground (Linux) - trunk
179
+ # On `ubuntu-latest`, this job fails because the CI runner is CPU bound
180
+ # when `monaco` is built.
181
+ #
182
+ # Trying 22.04 to see if it alleviates the problem.
183
+ #
184
+ # See <https://github.com/actions/runner-images/issues/6680>
185
+ runs-on : ubuntu-22.04
186
+ timeout-minutes : 25
187
+ steps :
188
+ - uses : actions/checkout@v4
189
+ - name : " Install Rust"
190
+ uses : dtolnay/rust-toolchain@master
191
+ with :
192
+ toolchain : stable
193
+ targets : wasm32-unknown-unknown
194
+
195
+ - name : trunk cache restore
196
+ id : trunk_cache_restore
197
+ uses : actions/cache/restore@v4
198
+ with :
199
+ path : ~/.cargo/bin/trunk
200
+ key : ${{ runner.os }}-trunk
201
+
202
+ - run : cargo install trunk
203
+ if : steps.trunk_cache_restore.outputs.cache-hit != 'true'
204
+
205
+ - name : trunk cache save
206
+ id : trunk_cache_save
207
+ uses : actions/cache/save@v4
208
+ if : always() && steps.trunk_cache_restore.outputs.cache-hit != 'true'
209
+ with :
210
+ path : ~/.cargo/bin/trunk
211
+ key : ${{ runner.os }}-trunk
212
+
213
+ - name : " Build playground"
164
214
working-directory : ./playground
165
- run : cargo leptos build --features "server_side_graphviz" -v
215
+ run : trunk build -v
166
216
167
217
build_and_test_windows :
168
218
name : Build and Test (Windows)
@@ -175,41 +225,42 @@ jobs:
175
225
- uses : actions/checkout@v4
176
226
- uses : dtolnay/rust-toolchain@stable
177
227
178
- - name : ' Build and test'
228
+ - name : " Build and test"
179
229
run : cargo test --workspace
180
230
181
- build_playground_windows :
182
- name : Build Playground (Windows)
231
+ build_playground_windows_trunk :
232
+ name : Build Playground (Windows) - trunk
183
233
runs-on : windows-latest
184
234
timeout-minutes : 30
185
235
steps :
186
236
- name : Prepare symlink configuration
187
237
run : git config --global core.symlinks true
188
238
189
239
- uses : actions/checkout@v4
190
- - name : ' Install Rust'
240
+ - name : " Install Rust"
191
241
uses : dtolnay/rust-toolchain@master
192
242
with :
193
243
toolchain : stable
194
244
targets : wasm32-unknown-unknown
195
245
196
- - name : cargo-leptos cache
197
- id : cargo-leptos-cache
198
- uses : actions/cache@v4
246
+ - name : trunk cache restore
247
+ id : trunk_cache_restore
248
+ uses : actions/cache/restore @v4
199
249
with :
200
- path : ' C:\Users\runneradmin\.cargo\bin\cargo-leptos .exe'
201
- key : cargo-leptos- ${{ runner.os }}
250
+ path : ' C:\Users\runneradmin\.cargo\bin\trunk .exe'
251
+ key : ${{ runner.os }}-trunk
202
252
203
- - name : cargo-leptos install
204
- if : steps.cargo-leptos-cache.outputs.cache-hit != 'true'
205
- # --locked: fix is in-progress at https://github.com/leptos-rs/cargo-leptos/pull/274
206
- run : |-
207
- cargo install cargo-leptos --locked
253
+ - run : cargo install trunk
254
+ if : steps.trunk_cache_restore.outputs.cache-hit != 'true'
208
255
209
- - name : ' Build playground'
210
- working-directory : ./playground
211
- run : cargo leptos build -v
256
+ - name : trunk cache save
257
+ id : trunk_cache_save
258
+ uses : actions/cache/save@v4
259
+ if : always() && steps.trunk_cache_restore.outputs.cache-hit != 'true'
260
+ with :
261
+ path : ' C:\Users\runneradmin\.cargo\bin\trunk.exe'
262
+ key : ${{ runner.os }}-trunk
212
263
213
- - name : ' Build playground (server side graphviz) '
264
+ - name : " Build playground"
214
265
working-directory : ./playground
215
- run : cargo leptos build --features "server_side_graphviz" -v
266
+ run : trunk build -v
0 commit comments