31
31
- name : Check rust formatting (rustfmt)
32
32
run : nox -s rustfmt
33
33
34
+ resolve :
35
+ runs-on : ubuntu-latest
36
+ outputs :
37
+ MSRV : ${{ steps.resolve-msrv.outputs.MSRV }}
38
+ steps :
39
+ - uses : actions/checkout@v4
40
+ - uses : actions/setup-python@v5
41
+ - name : resolve MSRV
42
+ id : resolve-msrv
43
+ run :
44
+ echo MSRV=`python -c 'import tomllib; print(tomllib.load(open("Cargo.toml", "rb"))["package"]["rust-version"])'` >> $GITHUB_OUTPUT
45
+
34
46
semver-checks :
35
47
if : github.ref != 'refs/heads/main'
36
48
needs : [fmt]
@@ -41,13 +53,13 @@ jobs:
41
53
- uses : obi1kenobi/cargo-semver-checks-action@v2
42
54
43
55
check-msrv :
44
- needs : [fmt]
56
+ needs : [fmt, resolve ]
45
57
runs-on : ubuntu-latest
46
58
steps :
47
59
- uses : actions/checkout@v4
48
60
- uses : dtolnay/rust-toolchain@master
49
61
with :
50
- toolchain : 1.63.0
62
+ toolchain : ${{ needs.resolve.outputs.MSRV }}
51
63
targets : x86_64-unknown-linux-gnu
52
64
components : rust-src
53
65
- uses : actions/setup-python@v5
57
69
with :
58
70
save-if : ${{ github.event_name != 'merge_group' }}
59
71
- run : python -m pip install --upgrade pip && pip install nox
60
- - name : Prepare minimal package versions
61
- run : nox -s set-minimal-package-versions
62
- - run : nox -s check-all
72
+ # This is a smoke test to confirm that CI will run on MSRV (including dev dependencies)
73
+ - name : Check with MSRV package versions
74
+ run : |
75
+ nox -s set-msrv-package-versions
76
+ nox -s check-all
63
77
64
78
env :
65
79
CARGO_BUILD_TARGET : x86_64-unknown-linux-gnu
@@ -141,14 +155,15 @@ jobs:
141
155
build-pr :
142
156
if : ${{ !contains(github.event.pull_request.labels.*.name, 'CI-build-full') && github.event_name == 'pull_request' }}
143
157
name : python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} rust-${{ matrix.rust }}
144
- needs : [fmt]
158
+ needs : [fmt, resolve ]
145
159
uses : ./.github/workflows/build.yml
146
160
with :
147
161
os : ${{ matrix.platform.os }}
148
162
python-version : ${{ matrix.python-version }}
149
163
python-architecture : ${{ matrix.platform.python-architecture }}
150
164
rust : ${{ matrix.rust }}
151
165
rust-target : ${{ matrix.platform.rust-target }}
166
+ MSRV : ${{ needs.resolve.outputs.MSRV }}
152
167
secrets : inherit
153
168
strategy :
154
169
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
@@ -198,14 +213,15 @@ jobs:
198
213
build-full :
199
214
if : ${{ contains(github.event.pull_request.labels.*.name, 'CI-build-full') || github.event_name != 'pull_request' }}
200
215
name : python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} rust-${{ matrix.rust }}
201
- needs : [fmt]
216
+ needs : [fmt, resolve ]
202
217
uses : ./.github/workflows/build.yml
203
218
with :
204
219
os : ${{ matrix.platform.os }}
205
220
python-version : ${{ matrix.python-version }}
206
221
python-architecture : ${{ matrix.platform.python-architecture }}
207
222
rust : ${{ matrix.rust }}
208
223
rust-target : ${{ matrix.platform.rust-target }}
224
+ MSRV : ${{ needs.resolve.outputs.MSRV }}
209
225
secrets : inherit
210
226
strategy :
211
227
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
@@ -251,7 +267,7 @@ jobs:
251
267
]
252
268
include :
253
269
# Test minimal supported Rust version
254
- - rust : 1.63.0
270
+ - rust : ${{ needs.resolve.outputs.MSRV }}
255
271
python-version : " 3.12"
256
272
platform :
257
273
{
@@ -487,21 +503,31 @@ jobs:
487
503
- run : python3 -m nox -s test-version-limits
488
504
489
505
check-feature-powerset :
490
- needs : [fmt]
506
+ needs : [fmt, resolve ]
491
507
if : ${{ contains(github.event.pull_request.labels.*.name, 'CI-build-full') || github.event_name != 'pull_request' }}
492
508
runs-on : ubuntu-latest
509
+ name : check-feature-powerset ${{ matrix.rust }}
510
+ strategy :
511
+ # run on stable and MSRV to check that all combinations of features are expected to build fine on our supported
512
+ # range of compilers
513
+ matrix :
514
+ rust : ["stable"]
515
+ include :
516
+ - rust : ${{ needs.resolve.outputs.MSRV }}
493
517
steps :
494
518
- uses : actions/checkout@v4
495
519
- uses : actions/setup-python@v5
496
520
- uses : Swatinem/rust-cache@v2
497
521
with :
498
522
save-if : ${{ github.event_name != 'merge_group' }}
499
- - uses : dtolnay/rust-toolchain@stable
523
+ - uses : dtolnay/rust-toolchain@master
500
524
with :
501
- components : rust-src
502
- - uses : taiki-e/install-action@cargo-hack
525
+ toolchain : stable
526
+ - uses : taiki-e/install-action@v2
527
+ with :
528
+ tool : cargo-hack,cargo-minimal-versions
503
529
- run : python3 -m pip install --upgrade pip && pip install nox
504
- - run : python3 -m nox -s check-feature-powerset
530
+ - run : python3 -m nox -s check-feature-powerset -- ${{ matrix.rust != 'stable' && 'minimal-versions' || '' }}
505
531
506
532
test-cross-compilation :
507
533
needs : [fmt]
0 commit comments