name: CI
on:
push:
branches: ["main"]
pull_request:
jobs:
docs:
name: API documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
with:
bins: cargo-docs-rs
cache-base: main
channel: nightly
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build API documentation
run: >-
cargo docs-rs --target x86_64-unknown-linux-gnu
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
with:
components: rustfmt
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check formatting
run: >-
cargo fmt --all --check
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
with:
components: clippy
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run linter
run: >-
cargo clippy --features full
- name: Run linter (all features)
run: >-
cargo clippy --all-features
test:
name: Test
runs-on: ${{ matrix.host }}
strategy:
matrix:
channel: [stable, beta, nightly]
host: [ubuntu-latest]
sqlite: [bundled]
include:
- channel: stable
host: ubuntu-22.04
sqlite: linked
- channel: stable
host: ubuntu-24.04
sqlite: linked
- channel: stable
host: ubuntu-24.04-arm
sqlite: linked
steps:
- uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
with:
cache-base: main
channel: ${{ matrix.channel }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests (default features)
run: >-
cargo test --no-default-features --features '${{ matrix.sqlite != 'linked' && matrix.sqlite || '' }} common derive multi-thread'
- name: Run tests (full features)
run: >-
cargo test --no-default-features --features '${{ matrix.sqlite != 'linked' && matrix.sqlite || '' }} full derive multi-thread'
- name: Run tests (full features + integrations)
run: >-
cargo test --no-default-features --features '${{ matrix.sqlite != 'linked' && matrix.sqlite || '' }} complete derive multi-thread'
- name: Run tests (full + nightly features)
run: >-
cargo test --no-default-features --features '${{ matrix.sqlite != 'linked' && matrix.sqlite || '' }} full derive multi-thread nightly'
- name: Run tests (all features)
run: >-
cargo test --all-features
if: matrix.channel != 'linked'
- name: Run tests (minimal features)
run: >-
cargo test --no-default-features --features '${{ matrix.sqlite != 'linked' && matrix.sqlite || '' }}' -- --test-threads=1