Skip to content

Commit

Permalink
CI: check compilation with MSRV (#447)
Browse files Browse the repository at this point in the history
As we are about to declare 1.59 as our minimum supported rust version,
this commit introduces a CI check that will help us enforce it. It runs
the `cargo check` command using the MSRV toolchain and verifies that it
passes with and without features enabled.

The check was inspired by tokio's CI configuration.
  • Loading branch information
piodul authored May 6, 2022
1 parent 47f58c1 commit 7690006
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
rust_min: 1.59.0 # <- Update this when bumping up MSRV

jobs:
build:
Expand All @@ -25,10 +27,27 @@ jobs:
- name: Format check
run: cargo fmt --verbose --all -- --check
- name: Clippy check
run: cargo clippy --verbose --examples --tests -- -D warnings
run: cargo clippy --verbose --examples --tests
- name: Cargo check without features
run: cargo check --manifest-path "scylla/Cargo.toml" --features ""
- name: Build
run: cargo build --verbose --examples
- name: Run tests
run: cargo test --verbose

# Tests that our current minimum supported rust version compiles everything sucessfully
min_rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust ${{ env.rust_min }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.rust_min }}
override: true
- name: Print Rust version
run: rustc --version
- name: MSRV cargo check with features
run: cargo check --verbose --examples --tests
- name: MSRV cargo check without features
run: cargo check --verbose --manifest-path "scylla/Cargo.toml"

0 comments on commit 7690006

Please sign in to comment.