Skip to content

Commit 422b3af

Browse files
authored
ci: add a job for minimum toolchain (MSRV) (#467)
This adds a new CI job to verify building with a minimum supported Rust version (MSRV), currently set at 1.57. This is done in preparation for a future edition-2021 switch. Signed-off-by: Luca BRUNO <[email protected]> Signed-off-by: Luca BRUNO <[email protected]>
1 parent c092b95 commit 422b3af

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/rust.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ env:
1010
CARGO_TERM_COLOR: always
1111
# Pinned toolchain for linting and benchmarks
1212
ACTIONS_LINTS_TOOLCHAIN: 1.63.0
13+
# Minimum supported Rust version (MSRV)
14+
ACTION_MSRV_TOOLCHAIN: 1.57.0
1315
EXTRA_FEATURES: "protobuf push process"
1416

1517
jobs:
@@ -57,6 +59,21 @@ jobs:
5759
run: cargo build -p prometheus-static-metric --examples --no-default-features --features="${{ env['EXTRA_FEATURES'] }}"
5860
- name: cargo test (static-metric)
5961
run: cargo test -p prometheus-static-metric --no-default-features --features="${{ env['EXTRA_FEATURES'] }}"
62+
build-msrv:
63+
name: "Build, minimum toolchain"
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Checkout repository
67+
uses: actions/checkout@v2
68+
- name: Install toolchain
69+
uses: actions-rs/toolchain@v1
70+
with:
71+
toolchain: ${{ env['ACTION_MSRV_TOOLCHAIN'] }}
72+
default: true
73+
- run: cargo build
74+
- run: cargo test --no-run
75+
- run: cargo build --no-default-features --features="${{ env['EXTRA_FEATURES'] }}"
76+
- run: cargo test --no-default-features --features="${{ env['EXTRA_FEATURES'] }}"
6077
linting:
6178
name: "Lints, pinned toolchain"
6279
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)