name: CI Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
ci:
name: Build, Lint, and Test (${{ matrix.backend }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
backend: [mysql, postgres, sqlite]
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Cache Cargo Registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache Cargo Build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-target-${{ matrix.backend }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-target-${{ matrix.backend }}-
- name: Check Code Formatting
run: cargo fmt -- --check
- name: Run Clippy Lint
run: cargo clippy --no-default-features --features "${{ matrix.backend }},runtime-tokio,tls-native-tls" --all-targets -- -D warnings
- name: Build the Library
run: cargo build --no-default-features --features "${{ matrix.backend }},runtime-tokio,tls-native-tls" --verbose
- name: Run Tests
run: cargo test --no-default-features --features "${{ matrix.backend }},runtime-tokio,tls-native-tls" --verbose