name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
quality:
name: Format, lint, and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev sqlite3
- run: cargo fmt --all -- --check
- run: cargo clippy --workspace --all-targets -- -D warnings
- run: cargo test --workspace
extension:
name: Extension on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev sqlite3
- if: runner.os == 'macOS'
run: |
brew install sqlite
echo "$(brew --prefix sqlite)/bin" >> "$GITHUB_PATH"
- if: runner.os == 'Windows'
shell: pwsh
run: choco install sqlite -y
- run: cargo build -p sqlite-functions-basic-extension --features loadable-extension
- if: runner.os == 'Linux'
run: ./scripts/test-extension.sh
- if: runner.os == 'macOS'
run: ./scripts/test-extension.sh
- if: runner.os == 'Windows'
shell: pwsh
run: ./scripts/test-extension.ps1