diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b9ca8c..1c13cbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,11 +17,27 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Install Rust (stable) - uses: dtolnay/rust-toolchain@stable - - - name: Cache Cargo - uses: Swatinem/rust-cache@v2 + # Force correct Rust version + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: 1.81.0 + components: rustfmt, clippy + override: true + + # Verify rustc version + - name: Check rustc version + run: rustc --version + + - name: Cache Cargo registry & target + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: cargo-cache-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} - name: Format check run: cargo fmt --all -- --check @@ -29,5 +45,5 @@ jobs: - name: Clippy (deny warnings) run: cargo clippy --all-targets --all-features -- -D warnings - - name: Unit tests + - name: Run tests run: cargo test --all --all-features --verbose diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml new file mode 100644 index 0000000..e25bd6d --- /dev/null +++ b/.github/workflows/msrv.yml @@ -0,0 +1,29 @@ +name: MSRV + +on: + push: + branches: + - master + tags: + - "*" + pull_request: + +jobs: + msrv: + name: Check MSRV + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Rust (MSRV) + uses: dtolnay/rust-toolchain@master + with: + toolchain: 1.80.1 # ← choose your MSRV + + - name: Cargo check + run: cargo check --all-features + + - name: Cargo test + run: cargo test --all-features diff --git a/Cargo.toml b/Cargo.toml index b8d8a0e..0366d83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,11 +9,10 @@ documentation = "http://manute.github.io/rawsql/rawsql/index.html" readme = "README.md" keywords = ["database", "sql"] - [lib] name = "rawsql" path = "src/lib.rs" doctest = false [dev-dependencies] -postgres = "0.19.2" +postgres = "0.19.12" diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..f19c7df --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.81.0" +components = ["rustfmt", "clippy"]