Skip to content

Commit c5a374e

Browse files
Run CI for the msrv and latest rust version (#61)
* remove old ci job * Build and test the MSRV and latest * speciifc msrv
1 parent 79ede59 commit c5a374e

3 files changed

Lines changed: 14 additions & 15 deletions

File tree

.github/workflows/rust-version.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/rust.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
branches: [main]
66
pull_request:
77

8-
env:
9-
RUSTFLAGS: -D warnings
10-
118
jobs:
129

1310
complete:
@@ -28,14 +25,27 @@ jobs:
2825
build-and-test:
2926
strategy:
3027
matrix:
28+
rust: [msrv, latest]
3129
include:
3230
- os: ubuntu-latest
3331
target: x86_64-unknown-linux-gnu
3432
runs-on: ${{ matrix.os }}
3533
steps:
3634
- uses: actions/checkout@v3
3735
- uses: stellar/actions/rust-cache@main
36+
- name: Use the minimum supported Rust version
37+
if: matrix.rust == 'msrv'
38+
run: |
39+
msrv="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages | map(.rust_version) | map(values) | min')"
40+
rustup override set $msrv
41+
rustup component add clippy --toolchain $msrv
42+
- name: Error on warnings and clippy checks
43+
# Only error on warnings and checks for the msrv, because new versions of
44+
# Rust will frequently add new warnings and checks.
45+
if: matrix.rust == 'msrv'
46+
run: echo RUSTFLAGS='-Dwarnings' >> $GITHUB_ENV
3847
- run: rustup update
48+
- run: cargo version
3949
- run: cargo build --target ${{ matrix.target }}
4050
- run: cargo test --target ${{ matrix.target }}
4151

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "Apache-2.0"
88
readme = "README.md"
99
version = "0.0.8"
1010
edition = "2021"
11-
rust-version = "1.67"
11+
rust-version = "1.67.0"
1212

1313
[features]
1414
default = []

0 commit comments

Comments
 (0)