mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-25 03:54:21 +01:00
105 lines
3.1 KiB
YAML
105 lines
3.1 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
cargo-fmt-check:
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: Check formatting
|
|
run: cargo fmt --check
|
|
|
|
build-native:
|
|
strategy:
|
|
matrix:
|
|
os: [blacksmith-4vcpu-ubuntu-2404, macos-latest, windows-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: useblacksmith/rust-cache@v3
|
|
with:
|
|
prefix-key: "v1-rust" # can be updated if we need to reset caches due to non-trivial change in the dependencies (for example, custom env var were set for single workspace project)
|
|
- name: Set up Python 3.10
|
|
uses: useblacksmith/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
- name: Build
|
|
run: cargo build --verbose
|
|
- name: Test
|
|
env:
|
|
RUST_LOG: ${{ runner.debug && 'limbo_core::storage=trace' || '' }}
|
|
run: cargo test --verbose
|
|
timeout-minutes: 20
|
|
|
|
|
|
clippy:
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Clippy
|
|
run: |
|
|
cargo clippy --workspace --all-features --all-targets --exclude limbo-wasm --exclude limbo_sqlite3_parser -- -A clippy::all -W clippy::correctness -W clippy::perf -W clippy::suspicious --deny=warnings
|
|
- name: Clippy `limbo-wasm` crate `nodejs` feature
|
|
run: |
|
|
cargo clippy --package limbo-wasm --features nodejs --all-targets --no-deps -- -A clippy::all -W clippy::correctness -W clippy::perf -W clippy::suspicious --deny=warnings
|
|
- name: Clippy `limbo-wasm` crate `web` feature
|
|
run: |
|
|
cargo clippy --package limbo-wasm --no-default-features --features web --all-targets --no-deps -- -A clippy::all -W clippy::correctness -W clippy::perf -W clippy::suspicious --deny=warnings
|
|
|
|
build-wasm:
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install
|
|
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
- run: wasm-pack build --target nodejs bindings/wasm
|
|
|
|
test-limbo:
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Install cargo-c
|
|
env:
|
|
LINK: https://github.com/lu-zero/cargo-c/releases/download/v0.10.7
|
|
CARGO_C_FILE: cargo-c-x86_64-unknown-linux-musl.tar.gz
|
|
run: |
|
|
curl -L $LINK/$CARGO_C_FILE | tar xz -C ~/.cargo/bin
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install uv
|
|
uses: useblacksmith/setup-uv@v4
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Set up Python
|
|
run: uv python install
|
|
|
|
- name: Install the project
|
|
run: uv sync --all-extras --dev --all-packages
|
|
|
|
- uses: "./.github/shared/install_sqlite"
|
|
- name: Test
|
|
run: make test
|
|
timeout-minutes: 20
|
|
|
|
test-sqlite:
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: "./.github/shared/install_sqlite"
|
|
- name: Test
|
|
run: SQLITE_EXEC="sqlite3" make test-compat
|
|
|