name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
RUST_BACKTRACE: 1
jobs:
test:
name: Test ${{ matrix.target }}
strategy:
fail-fast: true
matrix:
include:
- { target: x86_64-pc-windows-msvc, os: windows-latest, duckdb: libduckdb-windows-amd64.zip }
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, duckdb: libduckdb-linux-amd64.zip }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: stable${{ matrix.host }}
targets: ${{ matrix.target }}
components: 'rustfmt, clippy'
- uses: robinraju/release-downloader@v1.4
name: Download duckdb
with:
repository: "duckdb/duckdb"
tag: "v0.7.1"
fileName: ${{ matrix.duckdb }}
out-file-path: .
- name: Linux extract duckdb
if: matrix.os == 'ubuntu-latest'
uses: ihiroky/extract-action@v1
with:
file_path: ${{ github.workspace }}/${{ matrix.duckdb }}
extract_dir: libduckdb
- run: cargo fmt --all -- --check
if: matrix.os == 'ubuntu-latest'
- run: cargo clippy --all-targets --workspace --features buildtime_bindgen --features "modern-full" -- -D warnings -A clippy::redundant-closure
if: matrix.os == 'ubuntu-latest'
name: run cargo clippy
env:
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb
- name: Run cargo-tarpaulin
if: matrix.os == 'ubuntu-latest'
uses: actions-rs/tarpaulin@v0.1
with:
args: '--features "buildtime_bindgen" --features "modern-full" --avoid-cfg-tarpaulin' version: 0.22.0
env:
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb
- name: Upload to codecov.io
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v1
- name: Windows extract duckdb
if: matrix.os == 'windows-latest'
uses: DuckSoft/extract-7z-action@v1.0
with:
pathSource: D:\a\duckdb-rs\duckdb-rs\${{ matrix.duckdb }}
pathTarget: ${{ github.workspace }}/libduckdb
- name: Add path to PATH environment variable
if: matrix.os == 'windows-latest'
uses: myci-actions/export-env-var-powershell@1
with:
name: PATH
value: $env:PATH;${{ github.workspace }}/libduckdb
- name: Run cargo-test
if: matrix.os == 'windows-latest'
run: cargo test --features "buildtime_bindgen" --features "modern-full"
env:
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
Windows:
name: Windows build from source
needs: test
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: vcpkg install openssl:x64-windows
- run: echo "VCPKGRS_DYNAMIC=1" | Out-File -FilePath $env:GITHUB_ENV -Append
- uses: actions/cache@v3
with:
path: ~/.cargo/registry/index
key: index-${{ runner.os }}-${{ github.run_number }}
restore-keys: |
index-${{ runner.os }}-
- uses: hecrj/setup-rust-action@v1
with:
rust-version: stable
targets: x86_64-pc-windows-msvc
- run: cargo test --features "bundled" --features "modern-full extensions-full"
Sanitizer:
name: Address Sanitizer
needs: test
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=1"
RUST_BACKTRACE: "0"
run: cargo -Z build-std test --features 'bundled' --features 'modern-full extensions-full' --target x86_64-unknown-linux-gnu
- uses: wangfenjin/publish-crates@main
name: cargo publish --dry-run
with:
path: './'
args: --allow-dirty --all-features
dry-run: true
ignore-published: true