Skip to content

Exclude tests {mongo, redis} using features (#1463) #41

Exclude tests {mongo, redis} using features (#1463)

Exclude tests {mongo, redis} using features (#1463) #41

Workflow file for this run

name: Rust
on:
push:
branches: [main, release-*]
paths-ignore:
- "docs/**"
pull_request:
branches: [main, release-*]
paths-ignore:
- "docs/**"
env:
CARGO_TERM_COLOR: always
jobs:
clippy_workspace:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read rust-toolchain file
id: rust-toolchain
run: echo "toolchain=$(cat rust-toolchain)" >> $GITHUB_OUTPUT
- name: Add clippy
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.rust-toolchain.outputs.toolchain }}
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets -- -D warnings
rust_fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read rust-toolchain file
id: rust-toolchain
run: echo "toolchain=$(cat rust-toolchain)" >> $GITHUB_OUTPUT
- name: Add rustfmt
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.rust-toolchain.outputs.toolchain }}
components: rustfmt
- uses: Swatinem/rust-cache@v2
- run: |
cargo fmt -- --check
rust_build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: cargo build --all-features --verbose
run_tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: |
cd core && cargo test --verbose && cd ..
cd utils && cargo test --verbose && cd ..
cd cli && cargo test --verbose && cd ..
cd pkg/rust
cargo test --lib --bins --tests --examples --verbose --no-default-features --features "memory-storage sled-storage"
cd ../../
run_storage_tests:
name: Run storage tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: |
cd storages
cd memory-storage && cargo test --verbose && cd ..
cd shared-memory-storage && cargo test --verbose && cd ..
cd composite-storage && cargo test --verbose && cd ..
cd json-storage && cargo test --verbose && cd ..
cd csv-storage && cargo test --verbose && cd ..
cd parquet-storage && cargo test --verbose && cd ..
cd sled-storage
cargo test --verbose -- --skip sled_transaction_timeout
cargo test sled_transaction_timeout --verbose -- --test-threads=1
cargo test --benches
run_mongostorage_tests:
name: Run MongoStorage tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: MongoDB in GitHub Actions
uses: supercharge/[email protected]
- run: |
cd storages/mongo-storage
cargo test --verbose --features test-mongo
run_redisstorage_tests:
name: Run RedisStorage tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Redis in GitHub Actions
uses: supercharge/[email protected]
with:
redis-version: 6
- run: |
cd storages/redis-storage
cargo test --verbose --features test-redis
run_examples:
name: Run examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: |
cargo run --package gluesql --example hello_world
cargo run --package gluesql --example api_usage
cargo run --package gluesql --example memory_storage_usage
cargo run --package gluesql --example sled_multi_threaded
cargo run --package gluesql --example using_config
cargo run --package gluesql --example hello_ast_builder