Skip to content

Commit e19a050

Browse files
authored
Merge pull request #4024 from mulkieran/issue_project_819
github actions: use actions-rust-lang/setup-rust-toolchain
2 parents d979155 + 8f3d8cb commit e19a050

7 files changed

Lines changed: 86 additions & 122 deletions

File tree

.github/workflows/cargo.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ jobs:
4444
python-requests
4545
python-semantic_version
4646
systemd-devel
47-
- uses: dtolnay/rust-toolchain@master
48-
with:
49-
components: cargo
50-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
5147
- uses: actions/checkout@v6
5248
with:
5349
path: stratisd
5450
persist-credentials: false
51+
- uses: actions-rust-lang/setup-rust-toolchain@v1
52+
with:
53+
components: cargo
54+
rust-src-dir: stratisd
5555
- name: Check out ci repo
5656
uses: actions/checkout@v6
5757
with:

.github/workflows/fedora.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,40 +38,28 @@ jobs:
3838
matrix:
3939
include:
4040
- task: make -f Makefile clippy
41-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
4241
components: clippy
4342
- task: PROFILEDIR=debug make -f Makefile build
44-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
4543
components: cargo
4644
- task: PROFILEDIR=debug make -f Makefile build-min
47-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
4845
components: cargo
4946
- task: PROFILEDIR=debug make -f Makefile build-min-no-systemd
50-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
5147
components: cargo
5248
- task: PROFILEDIR=debug make -f Makefile build-utils
53-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
5449
components: cargo
5550
- task: PROFILEDIR=debug make -f Makefile build-no-ipc
56-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
5751
components: cargo
5852
- task: PROFILEDIR=debug make -f Makefile stratisd-tools
59-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
6053
components: cargo
6154
- task: make -f Makefile docs-ci
62-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
6355
components: cargo
6456
- task: make -f Makefile test
65-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
6657
components: cargo
6758
- task: make -f Makefile build
68-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
6959
components: cargo
7060
- task: make -f Makefile build-min
71-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
7261
components: cargo
7362
- task: make -f Makefile build-no-ipc
74-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
7563
components: cargo
7664
runs-on: ubuntu-24.04
7765
container:
@@ -92,13 +80,12 @@ jobs:
9280
ncurses
9381
sudo
9482
systemd-devel
95-
- uses: dtolnay/rust-toolchain@master
96-
with:
97-
components: ${{ matrix.components }}
98-
toolchain: ${{ matrix.toolchain }}
9983
- uses: actions/checkout@v6
10084
with:
10185
persist-credentials: false
86+
- uses: actions-rust-lang/setup-rust-toolchain@v1
87+
with:
88+
components: ${{ matrix.components }}
10289
- name: Overwrite stratisd dependencies as necessary
10390
uses: stratis-storage/github-actions/stratisd-modify@HEAD
10491
- name: Test ${{ matrix.task }} on ${{ matrix.toolchain }} toolchain

.github/workflows/main.yml

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ jobs:
3030
matrix:
3131
include:
3232
- task: make -f Makefile fmt-ci
33-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
3433
components: rustfmt
3534
- task: make -f Makefile check-typos
36-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
3735
components: cargo
3836
runs-on: ubuntu-24.04
3937
container:
@@ -52,17 +50,16 @@ jobs:
5250
make
5351
ncurses
5452
systemd-devel
55-
- uses: dtolnay/rust-toolchain@master
53+
- uses: actions/checkout@v6
54+
with:
55+
persist-credentials: false
56+
- uses: actions-rust-lang/setup-rust-toolchain@v1
5657
with:
5758
components: ${{ matrix.components }}
58-
toolchain: ${{ matrix.toolchain }}
5959
- uses: baptiste0928/cargo-install@v3
6060
with:
6161
crate: typos-cli
62-
- uses: actions/checkout@v6
63-
with:
64-
persist-credentials: false
65-
- name: Test ${{ matrix.task }} on ${{ matrix.toolchain }} toolchain
62+
- name: Test ${{ matrix.task }} on CURRENT DEVELOPMENT RUST TOOLCHAIN
6663
run: ${{ matrix.task }}
6764

6865
stratis-cli-checks:
@@ -94,14 +91,21 @@ jobs:
9491
python3-psutil
9592
python3-wcwidth
9693
systemd-devel
97-
- uses: dtolnay/rust-toolchain@master
98-
with:
99-
components: cargo
100-
toolchain: 1.85.0 # LOWEST SUPPORTED RUST TOOLCHAIN
94+
toml-cli
10195
- uses: actions/checkout@v6
10296
with:
10397
path: stratisd
10498
persist-credentials: false
99+
- name: Get package MSRV
100+
id: msrv
101+
run: |
102+
MSRV=$(toml get --toml-path Cargo.toml "workspace.package.rust-version")
103+
echo "MSRV=$MSRV" >> "$GITHUB_OUTPUT"
104+
working-directory: stratisd
105+
- uses: actions-rust-lang/setup-rust-toolchain@v1
106+
with:
107+
components: cargo
108+
toolchain: ${{ steps.msrv.outputs.MSRV }}
105109
- name: Overwrite stratisd dependencies as necessary
106110
uses: stratis-storage/github-actions/stratisd-modify@HEAD
107111
with:
@@ -161,13 +165,12 @@ jobs:
161165
python3-wcwidth
162166
systemd-devel
163167
xfsprogs
164-
- uses: dtolnay/rust-toolchain@master
165-
with:
166-
components: cargo
167-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
168168
- uses: actions/checkout@v6
169169
with:
170170
persist-credentials: false
171+
- uses: actions-rust-lang/setup-rust-toolchain@v1
172+
with:
173+
components: cargo
171174
- name: Overwrite stratisd dependencies as necessary
172175
uses: stratis-storage/github-actions/stratisd-modify@HEAD
173176
- name: Run stratisd-min cli tests
@@ -222,13 +225,12 @@ jobs:
222225
systemd-devel
223226
systemd-udev
224227
xfsprogs
225-
- uses: dtolnay/rust-toolchain@master
226-
with:
227-
components: cargo
228-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
229228
- uses: actions/checkout@v6
230229
with:
231230
persist-credentials: false
231+
- uses: actions-rust-lang/setup-rust-toolchain@v1
232+
with:
233+
components: cargo
232234
- name: Overwrite stratisd dependencies as necessary
233235
uses: stratis-storage/github-actions/stratisd-modify@HEAD
234236
- name: Build stratisd
@@ -265,6 +267,7 @@ jobs:
265267
libsystemd-dev
266268
libudev-dev
267269
make
270+
pip
268271
pkg-config
269272
thin-provisioning-tools
270273
udev
@@ -276,14 +279,22 @@ jobs:
276279
dbus-python-client-gen
277280
justbytes
278281
psutil
279-
- uses: dtolnay/rust-toolchain@master
280-
with:
281-
components: cargo
282-
toolchain: 1.85.0 # LOWEST SUPPORTED RUST TOOLCHAIN
282+
- name: Install toml-cli
283+
run: pip install --user toml-cli
283284
- uses: actions/checkout@v6
284285
with:
285286
path: stratisd
286287
persist-credentials: false
288+
- name: Get package MSRV
289+
id: msrv
290+
run: |
291+
PATH="$PATH:$(python3 -m site --user-base)/bin" MSRV=$(toml get --toml-path Cargo.toml "workspace.package.rust-version")
292+
echo "MSRV=$MSRV" >> "$GITHUB_OUTPUT"
293+
working-directory: stratisd
294+
- uses: actions-rust-lang/setup-rust-toolchain@v1
295+
with:
296+
components: cargo
297+
toolchain: ${{ steps.msrv.outputs.MSRV }}
287298
- name: Overwrite stratisd dependencies as necessary
288299
uses: stratis-storage/github-actions/stratisd-modify@HEAD
289300
with:

.github/workflows/nightly.yml

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
matrix:
1515
include:
1616
- task: cargo package
17-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
1817
components: cargo
1918
runs-on: ubuntu-24.04
2019
container:
@@ -35,14 +34,13 @@ jobs:
3534
python-requests
3635
python-semantic_version
3736
systemd-devel
38-
- uses: dtolnay/rust-toolchain@master
39-
with:
40-
components: ${{ matrix.components }}
41-
toolchain: ${{ matrix.toolchain }}
4237
- uses: actions/checkout@v6
4338
with:
4439
persist-credentials: false
45-
- name: Test ${{ matrix.task }} on ${{ matrix.toolchain }} toolchain
40+
- uses: actions-rust-lang/setup-rust-toolchain@v1
41+
with:
42+
components: ${{ matrix.components }}
43+
- name: Test ${{ matrix.task }} on CURRENT DEVELOPMENT RUST TOOLCHAIN
4644
run: ${{ matrix.task }}
4745

4846
check_future_dependencies:
@@ -64,16 +62,15 @@ jobs:
6462
ncurses
6563
openssl-devel
6664
systemd-devel
67-
- uses: dtolnay/rust-toolchain@master
65+
- uses: actions/checkout@v6
66+
with:
67+
persist-credentials: false
68+
- uses: actions-rust-lang/setup-rust-toolchain@v1
6869
with:
6970
components: cargo
70-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
7171
- uses: baptiste0928/cargo-install@v3
7272
with:
7373
crate: cargo-audit
74-
- uses: actions/checkout@v6
75-
with:
76-
persist-credentials: false
7774
- name: Run cargo-update
7875
run: cargo update
7976
- name: Build all targets
@@ -107,19 +104,18 @@ jobs:
107104
python-requests
108105
python-semantic_version
109106
systemd-devel
110-
- uses: dtolnay/rust-toolchain@master
107+
- uses: actions/checkout@v6
108+
with:
109+
persist-credentials: false
110+
- uses: actions-rust-lang/setup-rust-toolchain@v1
111111
with:
112112
components: cargo
113-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
114113
- uses: baptiste0928/cargo-install@v3
115114
with:
116115
crate: cargo-audit
117116
- uses: baptiste0928/cargo-install@v3
118117
with:
119118
crate: cargo-auditable
120-
- uses: actions/checkout@v6
121-
with:
122-
persist-credentials: false
123119
- name: Run matrix task
124120
run: ${{ matrix.task }}
125121

@@ -143,14 +139,14 @@ jobs:
143139
python-requests
144140
python-semantic_version
145141
systemd-devel
146-
- uses: dtolnay/rust-toolchain@master
147-
with:
148-
components: cargo
149-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
150142
- uses: actions/checkout@v6
151143
with:
152144
path: stratisd
153145
persist-credentials: false
146+
- uses: actions-rust-lang/setup-rust-toolchain@v1
147+
with:
148+
components: cargo
149+
rust-src-dir: stratisd
154150
- name: Check out ci repo
155151
uses: actions/checkout@v6
156152
with:
@@ -203,13 +199,12 @@ jobs:
203199
psutil
204200
pyudev
205201
tenacity
206-
- uses: dtolnay/rust-toolchain@master
207-
with:
208-
components: cargo
209-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
210202
- uses: actions/checkout@v6
211203
with:
212204
persist-credentials: false
205+
- uses: actions-rust-lang/setup-rust-toolchain@v1
206+
with:
207+
components: cargo
213208
- name: Build stratisd
214209
run: PROFILEDIR=debug make -f Makefile build-all
215210
- name: Install stratisd

0 commit comments

Comments
 (0)