From dc2df95a1f0a4fdc44f9ce98664d69b4dc9d5b25 Mon Sep 17 00:00:00 2001 From: azzamsa Date: Wed, 11 Oct 2023 11:07:02 +0700 Subject: [PATCH] feat: cargo support `rust-version` --- .github/workflows/ci.yml | 18 ++++++++++++------ Cargo.toml | 1 + clippy.toml | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d07e91..1f44212 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,5 @@ name: CI -env: - MIN_SUPPORTED_RUST_VERSION: "1.71.0" - on: [push, pull_request] jobs: @@ -26,12 +23,21 @@ jobs: - name: Install latest dprint release uses: taiki-e/install-action@dprint + - name: Check MSRV + run: | + cargo_msrv=$(sed -n 's/rust-version = "\(.*\)"/\1/p' Cargo.toml) + clippy_msrv=$(sed -n 's/msrv = "\(.*\)"/\1/p' clippy.toml) + + if [ "$cargo_msrv" != "$clippy_msrv" ]; then + echo "MSRV do not match" + exit 1 + else + echo "MSRV match" + fi + - name: Ensure `fmt` has been run run: just fmt-check - - name: Ensure MSRV is set in `clippy.toml` - run: grep "^msrv = \"${{ env.MIN_SUPPORTED_RUST_VERSION }}\"\$" clippy.toml - - name: Run clippy env: SQLX_OFFLINE: true diff --git a/Cargo.toml b/Cargo.toml index 7213f6b..efd14cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ keywords = ["boilerplate"] license = "MIT" publish = false repository = "https://github.com/azzamsa/tin" +rust-version = "1.73.0" description = "Rust GraphQL Template" [profile.release] diff --git a/clippy.toml b/clippy.toml index 8f7dac5..f09ac0f 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.71.0" +msrv = "1.73.0"