Skip to content

Commit efcb6c7

Browse files
committed
github actions: Use information in Cargo.toml to specify Rust toolchain
Signed-off-by: mulhern <amulhern@redhat.com>
1 parent 4dbd2b6 commit efcb6c7

2 files changed

Lines changed: 16 additions & 36 deletions

File tree

.github/workflows/main.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,45 +23,34 @@ jobs:
2323
matrix:
2424
include:
2525
- components: rustfmt
26-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
2726
task: make -f Makefile fmt-ci
2827
- components: clippy
29-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
3028
task: make -f Makefile clippy
3129
- components: cargo
32-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
3330
task: make -f Makefile build
3431
- components: cargo
35-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
3632
task: make -f Makefile docs
3733
- components: cargo
38-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
3934
task: make -f Makefile check-typos
4035
runs-on: ubuntu-22.04
4136
steps:
4237
- uses: actions/checkout@v6
4338
with:
4439
persist-credentials: false
45-
- uses: dtolnay/rust-toolchain@master
40+
- uses: actions-rust-lang/setup-rust-toolchain@v1
4641
with:
4742
components: ${{ matrix.components }}
48-
toolchain: ${{ matrix.toolchain }}
4943
- uses: baptiste0928/cargo-install@v3
5044
with:
5145
crate: typos-cli
5246
- name: Install dependencies
5347
run: |
5448
sudo apt-get -q update
5549
sudo apt-get -y install libdevmapper-dev
56-
- name: Test ${{ matrix.task }} on ${{ matrix.toolchain }} toolchain
50+
- name: Test ${{ matrix.task }} on CURRENT DEVELOPMENT RUST TOOLCHAIN
5751
run: ${{ matrix.task }}
5852

5953
tests-with-sudo:
60-
strategy:
61-
matrix:
62-
include:
63-
- toolchain: 1.85.0 # LOWEST SUPPORTED RUST TOOLCHAIN
64-
- toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
6554
runs-on: ubuntu-22.04
6655
steps:
6756
- uses: actions/checkout@v6
@@ -75,10 +64,19 @@ jobs:
7564
run: |
7665
sudo apt-get -q update
7766
sudo apt-get -y install libdevmapper-dev
78-
- name: Set toolchain override with sudo
79-
run: sudo /home/runner/.cargo/bin/rustup override set ${{ matrix.toolchain }}
8067
- name: Run all tests on ${{ matrix.toolchain }} toolchain
8168
run: sudo PATH=$GITHUB_WORKSPACE/.cargo/bin:$PATH make -f Makefile sudo_test
69+
- name: Install toml-cli
70+
run: pip install --user toml-cli
71+
- name: Get package MSRV
72+
id: msrv
73+
run: |
74+
PATH=${PATH}:/github/home/.local/bin MSRV=$(toml get --toml-path Cargo.toml "workspace.package.rust-version")
75+
echo "MSRV=$MSRV" >> "$GITHUB_OUTPUT"
76+
working-directory: devicemapper-rs
77+
- name: Set toolchain override with sudo
78+
run: sudo /home/runner/.cargo/bin/rustup override set ${{ steps.msrv.outputs.MSRV }}
79+
working-directory: devicemapper-rs
8280

8381
# VERIFICATION OF TEST INFRASTRUCTURE
8482
yamllint:

.github/workflows/nightly.yml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,23 @@ on:
1111
jobs:
1212
allowed_failures:
1313
continue-on-error: true
14-
strategy:
15-
matrix:
16-
include:
17-
- components: cargo
18-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
19-
task: make -f Makefile audit
20-
# Allowed because a failure may occur after a new Rust stable
21-
# version is released.
22-
- components: clippy
23-
toolchain: stable
24-
task: make -f Makefile clippy
2514
runs-on: ubuntu-22.04
2615
steps:
2716
- uses: actions/checkout@v6
2817
with:
2918
persist-credentials: false
3019
- uses: dtolnay/rust-toolchain@master
3120
with:
32-
components: ${{ matrix.components }}
33-
toolchain: ${{ matrix.toolchain }}
21+
components: cargo
3422
- name: Install dependencies
3523
run: |
3624
sudo apt-get -q update
3725
sudo apt-get -y install libdevmapper-dev
3826
- uses: baptiste0928/cargo-install@v3
3927
with:
4028
crate: cargo-audit
41-
- name: Test ${{ matrix.task }} on ${{ matrix.toolchain }} toolchain
42-
run: ${{ matrix.task }}
29+
- name: Audit check
30+
run: make -f Makefile audit
4331

4432
checks-with-ci-repo:
4533
runs-on: ubuntu-22.04
@@ -61,10 +49,6 @@ jobs:
6149
openssl-devel
6250
python-requests
6351
python-semantic_version
64-
- uses: dtolnay/rust-toolchain@master
65-
with:
66-
components: cargo
67-
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
6852
- name: Check out ci repo
6953
uses: actions/checkout@v6
7054
with:
@@ -98,10 +82,8 @@ jobs:
9882
uses: obi1kenobi/cargo-semver-checks-action@v2
9983
with:
10084
verbose: true
101-
rust-toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
10285
manifest-path: devicemapper-rs-sys
10386
- name: Do semantic version checks
10487
uses: obi1kenobi/cargo-semver-checks-action@v2
10588
with:
10689
verbose: true
107-
rust-toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN

0 commit comments

Comments
 (0)