bump loadable macros (#431) #842
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } | |
#- { 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 | |
# This has a matcher for test panics, so we use it even though elsewhere | |
# we use actions-rs/toolchain. | |
- uses: hecrj/setup-rust-action@v1 | |
with: | |
rust-version: stable${{ matrix.host }} | |
targets: ${{ matrix.target }} | |
components: 'rustfmt, clippy' | |
# download libduckdb | |
- uses: robinraju/release-downloader@v1.4 | |
name: Download duckdb | |
with: | |
repository: "duckdb/duckdb" | |
tag: "v1.2.0" | |
fileName: ${{ matrix.duckdb }} | |
out-file-path: . | |
# For Linux | |
- 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' | |
- name: run cargo clippy | |
if: matrix.os == 'ubuntu-latest' | |
env: | |
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb | |
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb | |
LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb | |
run: | | |
cargo clippy --all-targets --workspace --all-features -- -D warnings -A clippy::redundant-closure | |
# For windows | |
- 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 "modern-full vtab-full vtab-loadable" | |
env: | |
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb | |
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb | |
- name: Build loadable extension | |
run: cargo build --example hello-ext --features="vtab-loadable" | |
env: | |
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb | |
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb | |
LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb | |
- name: Build loadable extension | |
run: cargo build --example hello-ext-capi --features="vtab-loadable loadable-extension" | |
env: | |
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb | |
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb | |
LD_LIBRARY_PATH: ${{ github.workspace }}/libduckdb | |
Windows: | |
name: Windows build from source | |
needs: test | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- 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 install cargo-examples |