name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: "00 01 * * *"
env:
RUST_BACKTRACE: 1
jobs:
test:
name: Test ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
include:
- { target: x86_64-pc-windows-msvc, os: windows-latest }
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
- { target: x86_64-apple-darwin, os: macos-latest }
- {
target: x86_64-pc-windows-gnu,
os: windows-latest,
host: -x86_64-pc-windows-gnu,
}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: stable${{ matrix.host }}
targets: ${{ matrix.target }}
- run: cargo build --features bundled --workspace --all-targets --verbose
- run: cargo test --features bundled --workspace --all-targets --verbose
- run: cargo test --features bundled --workspace --doc --verbose
- name: Test Features
if: matrix.os != 'windows-latest'
run: |
cargo test --features 'bundled-full session buildtime_bindgen' --all-targets --workspace --verbose
cargo test --features 'bundled-full session buildtime_bindgen' --doc --workspace --verbose
- name: Static build
if: matrix.os == 'x86_64-pc-windows-msvc'
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
run: cargo build --features bundled
test-sqlcipher-bundled:
name: Test ${{ matrix.os }} (bundled SQLcipher + OpenSSL)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: stable${{ matrix.host }}
targets: ${{ matrix.target }}
- run: cargo test --features 'bundled-sqlcipher' --workspace --all-targets --verbose
- run: cargo test --features 'bundled-sqlcipher' --workspace --doc --verbose
- run: cargo test --features 'modern-full bundled-sqlcipher' --workspace --all-targets --verbose
- run: cargo test --features 'modern-full bundled-sqlcipher' --workspace --doc --verbose
- run: cargo test --features 'bundled-sqlcipher-vendored-openssl' --workspace --all-targets --verbose
- run: cargo test --features 'bundled-sqlcipher-vendored-openssl' --workspace --doc --verbose
- run: cargo test --features 'modern-full bundled-sqlcipher-vendored-openssl' --all-targets --workspace --verbose
- run: cargo test --features 'modern-full bundled-sqlcipher-vendored-openssl' --doc --workspace --verbose
- name: Test Features
if: matrix.os != 'windows-latest'
run: |
cargo test --features 'bundled-full session buildtime_bindgen' --all-targets --workspace --verbose
cargo test --features 'bundled-full session buildtime_bindgen' --doc --workspace --verbose
winsqlite3:
name: Test with winsqlite3
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
- run: cargo build --features winsqlite3 --workspace --all-targets --verbose
- run: cargo test --features winsqlite3 --workspace --all-targets --verbose
sqlcipher:
name: Test with sqlcipher
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
- run: sudo apt-get install sqlcipher libsqlcipher-dev
- run: sqlcipher --version
- run: cargo build --features sqlcipher --workspace --all-targets --verbose
- run: cargo test --features sqlcipher --workspace --all-targets --verbose
sanitizer:
name: Address Sanitizer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
components: rust-src
- name: Tests with asan
env:
RUSTFLAGS: -Zsanitizer=address
RUSTDOCFLAGS: -Zsanitizer=address
ASAN_OPTIONS: "detect_stack_use_after_return=1:detect_leaks=0"
RUST_BACKTRACE: "0"
run: cargo -Z build-std test --features 'bundled-full session buildtime_bindgen with-asan' --target x86_64-unknown-linux-gnu
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
components: clippy
- run: cargo clippy --all-targets --workspace --features bundled -- -D warnings
- run: cargo clippy --all-targets --workspace --features 'bundled-full session buildtime_bindgen' -- -D warnings
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
components: rustfmt
- run: cargo fmt --all -- --check
doc:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
- run: cargo rustdoc --features 'bundled-full session buildtime_bindgen' -- -D warnings
codecov:
name: Generate code coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
args: "--features bundled-full"
- name: Upload to codecov.io
uses: codecov/codecov-action@v1