Skip to content

Commit

Permalink
feat: cargo support rust-version
Browse files Browse the repository at this point in the history
  • Loading branch information
azzamsa committed Oct 11, 2023
1 parent fdd3540 commit dc2df95
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: CI

env:
MIN_SUPPORTED_RUST_VERSION: "1.71.0"

on: [push, pull_request]

jobs:
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.71.0"
msrv = "1.73.0"

0 comments on commit dc2df95

Please sign in to comment.