3
3
on :
4
4
push :
5
5
branches : ["master"]
6
- tags : ["juniper*@* "]
6
+ tags : ["juniper*"]
7
7
pull_request :
8
8
branches : ["master"]
9
9
27
27
- clippy
28
28
- example
29
29
- feature
30
+ - msrv
30
31
- release-check
31
32
- rustfmt
32
33
- test
47
48
runs-on : ubuntu-latest
48
49
steps :
49
50
- uses : actions/checkout@v3
50
- - uses : actions-rs/ toolchain@v1
51
+ - uses : dtolnay/rust- toolchain@v1
51
52
with :
52
- profile : minimal
53
53
toolchain : stable
54
54
components : clippy
55
55
59
59
runs-on : ubuntu-latest
60
60
steps :
61
61
- uses : actions/checkout@v3
62
- - uses : actions-rs/ toolchain@v1
62
+ - uses : dtolnay/rust- toolchain@v1
63
63
with :
64
- profile : minimal
65
64
toolchain : nightly
66
65
components : rustfmt
67
66
78
77
runs-on : ubuntu-latest
79
78
steps :
80
79
- uses : actions/checkout@v3
81
- - uses : actions-rs/ toolchain@v1
80
+ - uses : dtolnay/rust- toolchain@v1
82
81
with :
83
- profile : minimal
84
82
toolchain : stable
85
- override : true
86
83
87
84
- run : cargo clippy -p juniper_benchmarks --benches -- -D warnings
88
85
- run : cargo bench -p juniper_benchmarks
@@ -107,11 +104,10 @@ jobs:
107
104
runs-on : ${{ matrix.os }}-latest
108
105
steps :
109
106
- uses : actions/checkout@v3
110
- - uses : actions-rs/ toolchain@v1
107
+ - uses : dtolnay/rust- toolchain@v1
111
108
with :
112
- profile : minimal
113
109
toolchain : ${{ matrix.toolchain }}
114
- override : true
110
+ - run : rustup default ${{ matrix.toolchain }}
115
111
116
112
- run : cargo check -p example_${{ matrix.example }}
117
113
@@ -141,14 +137,14 @@ jobs:
141
137
runs-on : ubuntu-latest
142
138
steps :
143
139
- uses : actions/checkout@v3
144
- - uses : actions-rs/ toolchain@v1
140
+ - uses : dtolnay/rust- toolchain@v1
145
141
with :
146
- profile : minimal
147
142
toolchain : stable
148
- override : true
143
+ - uses : dtolnay/rust-toolchain@v1
144
+ with :
145
+ toolchain : nightly
149
146
150
- # TODO: Enable once MSRV is supported.
151
- # - run: cargo +nightly update -Z minimal-versions
147
+ - run : cargo +nightly update -Z minimal-versions
152
148
153
149
- run : cargo check -p ${{ matrix.crate }} --no-default-features
154
150
${{ matrix.feature != '<none>'
@@ -157,23 +153,58 @@ jobs:
157
153
env :
158
154
RUSTFLAGS : -D warnings
159
155
156
+ msrv :
157
+ name : MSRV
158
+ strategy :
159
+ fail-fast : false
160
+ matrix :
161
+ msrv : ["1.62.0"]
162
+ crate :
163
+ - juniper_codegen
164
+ - juniper
165
+ - juniper_subscriptions
166
+ - juniper_graphql_ws
167
+ - juniper_actix
168
+ - juniper_hyper
169
+ # - juniper_iron
170
+ - juniper_rocket
171
+ - juniper_warp
172
+ os :
173
+ - ubuntu
174
+ - macOS
175
+ - windows
176
+ runs-on : ${{ matrix.os }}-latest
177
+ steps :
178
+ - uses : actions/checkout@v3
179
+ - uses : dtolnay/rust-toolchain@v1
180
+ with :
181
+ toolchain : ${{ matrix.msrv }}
182
+ - run : rustup default ${{ matrix.msrv }}
183
+ - uses : dtolnay/rust-toolchain@v1
184
+ with :
185
+ toolchain : nightly
186
+
187
+ - run : cargo +nightly update -Z minimal-versions
188
+
189
+ - run : make test.cargo crate=${{ matrix.crate }}
190
+
160
191
package :
161
192
if : ${{ startsWith(github.ref, 'refs/tags/juniper') }}
162
193
runs-on : ubuntu-latest
163
194
steps :
164
195
- uses : actions/checkout@v3
165
- - uses : actions-rs/ toolchain@v1
196
+ - uses : dtolnay/rust- toolchain@v1
166
197
with :
167
- profile : minimal
168
198
toolchain : stable
169
199
170
- - name : Parse crate name
171
- id : crate
172
- run : echo ::set-output
173
- name=NAME::$(printf "$GITHUB_REF" | cut -d '/' -f3
174
- | cut -d '@' -f1)
200
+ - name : Parse crate name and version from Git tag
201
+ id : tag
202
+ uses : actions-ecosystem/action-regex-match@v2
203
+ with :
204
+ text : ${{ github.ref }}
205
+ regex : ' ^refs/tags/(([a-z_]+)-v([0-9]+\.[0-9]+\.[0-9]+(-.+)?))$'
175
206
176
- - run : cargo package -p ${{ steps.crate .outputs.NAME }}
207
+ - run : cargo package -p ${{ steps.tag .outputs.group2 }}
177
208
178
209
test :
179
210
strategy :
@@ -211,13 +242,18 @@ jobs:
211
242
runs-on : ${{ matrix.os }}-latest
212
243
steps :
213
244
- uses : actions/checkout@v3
214
- - uses : actions-rs/ toolchain@v1
245
+ - uses : dtolnay/rust- toolchain@v1
215
246
with :
216
- profile : minimal
217
247
toolchain : ${{ matrix.toolchain }}
218
- override : true
248
+ components : rust-src
249
+ - run : rustup default ${{ matrix.toolchain }}
250
+
251
+ - run : cargo install cargo-careful
252
+ if : ${{ matrix.toolchain == 'nightly' }}
219
253
220
254
- run : make test.cargo crate=${{ matrix.crate }}
255
+ careful=${{ (matrix.toolchain == 'nightly' && 'yes')
256
+ || 'no' }}
221
257
222
258
test-book :
223
259
name : test Book
@@ -237,11 +273,10 @@ jobs:
237
273
runs-on : ${{ matrix.os }}-latest
238
274
steps :
239
275
- uses : actions/checkout@v3
240
- - uses : actions-rs/ toolchain@v1
276
+ - uses : dtolnay/rust- toolchain@v1
241
277
with :
242
- profile : minimal
243
278
toolchain : ${{ matrix.toolchain }}
244
- override : true
279
+ - run : rustup default ${{ matrix.toolchain }}
245
280
246
281
- run : cargo install mdbook
247
282
@@ -261,12 +296,11 @@ jobs:
261
296
runs-on : ubuntu-latest
262
297
steps :
263
298
- uses : actions/checkout@v3
264
- - uses : actions-rs/ toolchain@v1
299
+ - uses : dtolnay/rust- toolchain@v1
265
300
with :
266
- profile : minimal
267
301
toolchain : ${{ matrix.toolchain }}
268
302
target : wasm32-unknown-unknown
269
- override : true
303
+ - run : rustup default ${{ matrix.toolchain }}
270
304
271
305
- run : cargo check --target wasm32-unknown-unknown -p ${{ matrix.crate }}
272
306
@@ -278,7 +312,7 @@ jobs:
278
312
# ############
279
313
280
314
release-check :
281
- name : Check release automation
315
+ name : check release
282
316
if : ${{ !startsWith(github.ref, 'refs/tags/juniper') }}
283
317
strategy :
284
318
fail-fast : false
@@ -296,23 +330,45 @@ jobs:
296
330
runs-on : ubuntu-latest
297
331
steps :
298
332
- uses : actions/checkout@v3
299
- - uses : actions-rs/ toolchain@v1
333
+ - uses : dtolnay/rust- toolchain@v1
300
334
with :
301
- profile : minimal
302
335
toolchain : stable
303
336
304
337
- run : cargo install cargo-release
305
338
306
339
- run : make cargo.release crate=${{ matrix.crate }} ver=minor
307
340
exec=no install=no
308
341
342
+ release-crate :
343
+ name : release on crates.io
344
+ needs : ["release-github"]
345
+ if : ${{ startsWith(github.ref, 'refs/tags/juniper') }}
346
+ runs-on : ubuntu-latest
347
+ steps :
348
+ - uses : actions/checkout@v3
349
+ - uses : dtolnay/rust-toolchain@v1
350
+ with :
351
+ toolchain : stable
352
+
353
+ - name : Parse crate name and version from Git tag
354
+ id : tag
355
+ uses : actions-ecosystem/action-regex-match@v2
356
+ with :
357
+ text : ${{ github.ref }}
358
+ regex : ' ^refs/tags/(([a-z_]+)-v([0-9]+\.[0-9]+\.[0-9]+(-.+)?))$'
359
+
360
+ - name : Publish `${{ steps.tag.outputs.group2 }}` crate
361
+ run : cargo publish -p ${{ steps.tag.outputs.group2 }}
362
+ --token ${{ secrets.CRATESIO_TOKEN }}
363
+
309
364
release-github :
310
- name : Release on GitHub
365
+ name : release on GitHub
311
366
needs :
312
367
- bench
313
368
- clippy
314
369
- example
315
370
- feature
371
+ - msrv
316
372
- package
317
373
- rustfmt
318
374
- test
@@ -323,56 +379,31 @@ jobs:
323
379
steps :
324
380
- uses : actions/checkout@v3
325
381
326
- - name : Parse crate name
327
- id : crate
328
- run : echo ::set-output
329
- name=NAME::$(printf "$GITHUB_REF" | cut -d '/' -f3
330
- | cut -d '@' -f1)
331
- - name : Parse release version
332
- id : release
333
- run : echo ::set-output
334
- name=VERSION::$(printf "$GITHUB_REF" | cut -d '@' -f2)
335
-
382
+ - name : Parse crate name and version from Git tag
383
+ id : tag
384
+ uses : actions-ecosystem/action-regex-match@v2
385
+ with :
386
+ text : ${{ github.ref }}
387
+ regex : ' ^refs/tags/(([a-z_]+)-v([0-9]+\.[0-9]+\.[0-9]+(-.+)?))$'
336
388
- name : Verify release version matches crate's Cargo manifest
337
- run : >-
338
- test "${{ steps.release.outputs.VERSION }}" \
339
- == "$(grep -m1 'version = "' ${{ steps.crate.outputs.NAME }}/Cargo.toml | cut -d '"' -f2)"
389
+ run : |
390
+ test "${{ steps.tag.outputs.group3 }}" \
391
+ == "$(grep -m1 'version = "' \
392
+ ${{ steps.tag.outputs.group2 }}/Cargo.toml \
393
+ | cut -d '"' -f2)"
394
+
340
395
- name : Parse CHANGELOG link
341
396
id : changelog
342
397
run : echo ::set-output
343
- name=LINK ::${{ github.server_url }}/${{ github.repository }}/blob/${{ steps.crate .outputs.NAME }}%40${{ steps.release.outputs.VERSION }}// ${{ steps.crate .outputs.NAME }}/CHANGELOG.md#$(sed -n '/^## \[${{ steps.release .outputs.VERSION }}\]/{s/^## \[\(.*\)\][^0-9]*\([0-9].*\)/\1--\2/;s/[^0-9a-z-]*//g;p;}' ${{ steps.crate .outputs.NAME }}/CHANGELOG.md)
398
+ name=link ::${{ github.server_url }}/${{ github.repository }}/blob/${{ steps.tag .outputs.group1 }}/ ${{ steps.tag .outputs.group2 }}/CHANGELOG.md#$(sed -n '/^## \[${{ steps.tag .outputs.group3 }}\]/{s/^## \[\(.*\)\][^0-9]*\([0-9].*\)/\1--\2/;s/[^0-9a-z-]*//g;p;}' ${{ steps.tag .outputs.group2 }}/CHANGELOG.md)
344
399
345
400
- uses : softprops/action-gh-release@v1
346
- env :
347
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
348
401
with :
349
- name : ${{ steps.crate .outputs.NAME }} ${{ steps.release .outputs.VERSION }}
402
+ name : ${{ steps.tag .outputs.group2 }} ${{ steps.tag .outputs.group3 }}
350
403
body : |
351
- [API docs](https://docs.rs/${{ steps.crate.outputs.NAME }}/${{ steps.release.outputs.VERSION }})
352
- [Changelog](${{ steps.changelog.outputs.LINK }})
353
- prerelease : ${{ contains(steps.release.outputs.VERSION, '-') }}
354
-
355
- release-crate :
356
- name : Release on crates.io
357
- needs : ["release-github"]
358
- if : ${{ startsWith(github.ref, 'refs/tags/juniper') }}
359
- runs-on : ubuntu-latest
360
- steps :
361
- - uses : actions/checkout@v3
362
- - uses : actions-rs/toolchain@v1
363
- with :
364
- profile : minimal
365
- toolchain : stable
366
-
367
- - name : Parse crate name
368
- id : crate
369
- run : echo ::set-output
370
- name=NAME::$(printf "$GITHUB_REF" | cut -d '/' -f3
371
- | cut -d '@' -f1)
372
-
373
- - name : Publish crate
374
- run : cargo publish -p ${{ steps.crate.outputs.NAME }}
375
- --token ${{ secrets.CRATESIO_TOKEN }}
404
+ [API docs](https://docs.rs/${{ steps.tag.outputs.group2 }}/${{ steps.tag.outputs.group3 }})
405
+ [Changelog](${{ steps.changelog.outputs.link }})
406
+ prerelease : ${{ contains(steps.tag.outputs.group3, '-') }}
376
407
377
408
378
409
0 commit comments