@@ -38,23 +38,29 @@ jobs:
38
38
runs-on : ubuntu-22.04
39
39
steps :
40
40
- uses : actions/checkout@v3
41
- with :
42
- submodules : true
43
41
44
42
- uses : actions/setup-python@v4
45
43
with :
46
- python-version : 3.7
44
+ python-version : 3.11
45
+ cache : ' pip'
46
+ cache-dependency-path : ' **/requirements-*.txt'
47
47
48
48
- name : Start background server
49
49
run : |
50
- python -m pip install flask
50
+ python -m pip install -r ./css-inline/tests/requirements-test.txt
51
51
# Starts the server in background
52
52
python ./css-inline/tests/server.py &
53
+
53
54
- uses : actions-rs/toolchain@v1
54
55
with :
55
56
profile : minimal
56
57
toolchain : stable
57
58
override : true
59
+
60
+ - uses : Swatinem/rust-cache@v2
61
+ with :
62
+ workspaces : css-inline
63
+
58
64
- run : cargo test --no-fail-fast
59
65
working-directory : ./css-inline
60
66
@@ -63,12 +69,14 @@ jobs:
63
69
runs-on : ubuntu-22.04
64
70
steps :
65
71
- uses : actions/checkout@v3
72
+
66
73
- uses : actions-rs/toolchain@v1
67
74
with :
68
75
profile : minimal
69
76
toolchain : stable
70
77
override : true
71
78
components : rustfmt
79
+
72
80
- run : cargo fmt --all -- --check
73
81
working-directory : ./css-inline
74
82
@@ -77,15 +85,33 @@ jobs:
77
85
runs-on : ubuntu-22.04
78
86
steps :
79
87
- uses : actions/checkout@v3
88
+
80
89
- uses : actions-rs/toolchain@v1
81
90
with :
82
91
profile : minimal
83
92
toolchain : stable
84
93
override : true
85
94
components : clippy
86
- - run : cargo clippy -- -D warnings
95
+
96
+ - uses : Swatinem/rust-cache@v2
97
+ with :
98
+ workspaces : |
99
+ css-inline
100
+ bindings/python
101
+ bindings/wasm
102
+
103
+ - name : Rust
104
+ run : cargo clippy -- -D warnings
87
105
working-directory : ./css-inline
88
106
107
+ - name : Python
108
+ run : cargo clippy -- -D warnings
109
+ working-directory : ./bindings/python
110
+
111
+ - name : WASM
112
+ run : cargo clippy -- -D warnings
113
+ working-directory : ./bindings/wasm
114
+
89
115
msrv :
90
116
name : MSRV
91
117
runs-on : ubuntu-22.04
@@ -96,35 +122,45 @@ jobs:
96
122
profile : minimal
97
123
toolchain : " 1.60"
98
124
override : true
125
+ - uses : Swatinem/rust-cache@v2
126
+ with :
127
+ workspaces : css-inline
99
128
- run : cargo build
100
129
working-directory : ./css-inline
101
130
102
131
test-python :
103
132
strategy :
104
133
fail-fast : false
105
134
matrix :
106
- os : [ubuntu-22.04, macos-11 , windows-2019 ]
135
+ os : [ubuntu-22.04, macos-12 , windows-2022 ]
107
136
python-version : ['3.7', '3.8', '3.9', '3.10', '3.11']
108
137
109
138
name : Python ${{ matrix.python-version }} on ${{ matrix.os }}
110
139
runs-on : ${{ matrix.os }}
111
140
steps :
112
141
- uses : actions/checkout@v3
142
+
143
+ - uses : actions-rs/toolchain@v1
144
+ with :
145
+ profile : minimal
146
+ toolchain : stable
147
+ override : true
148
+
149
+ - uses : Swatinem/rust-cache@v2
113
150
with :
114
- submodules : true
151
+ workspaces : bindings/python
152
+ key : ${{ matrix.os }}-${{ matrix.python-version }}
153
+
115
154
- uses : actions/setup-python@v4
116
155
with :
117
156
python-version : ${{ matrix.python-version }}
118
157
architecture : x64
158
+ cache : ' pip'
159
+ cache-dependency-path : ' **/requirements-*.txt'
119
160
120
- - run : python -m pip install tox
161
+ - run : python -m pip install -r requirements-dev.txt
121
162
working-directory : ./bindings/python
122
163
123
- - uses : actions-rs/toolchain@v1
124
- with :
125
- toolchain : stable
126
- override : true
127
-
128
164
- name : Run ${{ matrix.python }} tox job
129
165
run : tox -e py
130
166
working-directory : ./bindings/python
@@ -134,18 +170,24 @@ jobs:
134
170
runs-on : ubuntu-22.04
135
171
steps :
136
172
- uses : actions/checkout@v3
137
- with :
138
- submodules : true
173
+
139
174
- uses : actions-rs/toolchain@v1
140
175
with :
141
176
profile : minimal
142
177
toolchain : stable
143
178
override : true
179
+
180
+ - uses : Swatinem/rust-cache@v2
181
+ with :
182
+ workspaces : bindings/wasm
183
+ cache-all-crates : " true"
184
+
144
185
- name : Install wasm-pack
145
186
uses : actions-rs/cargo@v1
146
187
with :
147
188
command : install
148
189
args : wasm-pack
190
+
149
191
- name : Run tests
150
192
run : wasm-pack test --node --release
151
193
working-directory : ./bindings/wasm
@@ -155,24 +197,34 @@ jobs:
155
197
runs-on : ubuntu-22.04
156
198
steps :
157
199
- uses : actions/checkout@v3
158
- with :
159
- submodules : true
200
+
160
201
- uses : actions-rs/toolchain@v1
161
202
with :
162
203
profile : minimal
163
204
toolchain : stable
164
205
override : true
206
+
207
+ - uses : Swatinem/rust-cache@v2
208
+ with :
209
+ workspaces : |
210
+ css-inline
211
+ bindings/wasm
212
+ cache-all-crates : " true"
213
+
165
214
- name : Install wasm-pack
166
215
uses : actions-rs/cargo@v1
167
216
with :
168
217
command : install
169
218
args : wasm-pack
219
+
170
220
- name : Build package
171
221
run : wasm-pack build -t nodejs
172
222
working-directory : ./bindings/wasm
223
+
173
224
- name : Install dependencies
174
225
run : npm install
175
226
working-directory : ./bindings/wasm
227
+
176
228
- name : Run tests
177
229
run : npm run test
178
230
working-directory : ./bindings/wasm
@@ -182,14 +234,20 @@ jobs:
182
234
runs-on : ubuntu-22.04
183
235
steps :
184
236
- uses : actions/checkout@v3
185
- with :
186
- submodules : true
237
+
187
238
- uses : actions-rs/toolchain@v1
188
239
with :
189
240
profile : minimal
190
241
toolchain : stable
191
242
override : true
243
+
244
+ - uses : Swatinem/rust-cache@v2
245
+ with :
246
+ workspaces : css-inline
247
+ cache-all-crates : " true"
248
+
192
249
- uses : taiki-e/install-action@cargo-hack
250
+
193
251
- run : cargo hack check --feature-powerset --lib
194
252
working-directory : ./css-inline
195
253
@@ -198,23 +256,17 @@ jobs:
198
256
runs-on : ubuntu-22.04
199
257
steps :
200
258
- uses : actions/checkout@v3
201
- with :
202
- submodules : true
203
259
204
260
- uses : actions-rs/toolchain@v1
205
261
with :
206
262
profile : minimal
207
263
toolchain : stable
208
264
override : true
209
265
210
- - name : Cache cargo
211
- uses : actions/cache@v3
266
+ - uses : Swatinem/rust-cache@v2
212
267
with :
213
- path : |
214
- ~/.cargo/registry
215
- ~/.cargo/git
216
- target
217
- key : coverage-cargo-cache
268
+ workspaces : css-inline
269
+ cache-all-crates : " true"
218
270
219
271
- name : Install cargo-llvm-cov
220
272
uses : taiki-e/install-action@cargo-llvm-cov
@@ -223,16 +275,18 @@ jobs:
223
275
224
276
- uses : actions/setup-python@v4
225
277
with :
226
- python-version : 3.7
278
+ python-version : 3.11
279
+ cache : ' pip'
280
+ cache-dependency-path : ' **/requirements-*.txt'
227
281
228
282
- name : Start background server
229
283
run : |
230
- python -m pip install flask
284
+ python -m pip install -r ./css-inline/tests/requirements-test.txt
231
285
# Starts the server in background
232
286
python ./css-inline/tests/server.py &
233
287
234
288
- name : Run tests
235
- run : cargo hack llvm-cov --no-report
289
+ run : cargo hack llvm-cov --no-report --feature-powerset
236
290
working-directory : ./css-inline
237
291
238
292
- name : Generate coverage reports
@@ -253,7 +307,15 @@ jobs:
253
307
runs-on : ubuntu-22.04
254
308
steps :
255
309
- uses : actions/checkout@v3
310
+
256
311
- uses : dtolnay/rust-toolchain@nightly
312
+
313
+ - uses : Swatinem/rust-cache@v2
314
+ with :
315
+ workspaces : css-inline
316
+ cache-all-crates : " true"
317
+
257
318
- run : cargo install cargo-fuzz
319
+
258
320
- run : cargo fuzz run inline -- -max_total_time=60
259
321
working-directory : ./css-inline
0 commit comments