chore: normalize transform #4803
Workflow file for this run
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: Build and run Rust tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- rust/** | |
- protos/** | |
- .github/workflows/rust.yml | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
# This env var is used by Swatinem/rust-cache@v2 for the cache | |
# key, so we set it to make sure it is always consistent. | |
CARGO_TERM_COLOR: always | |
# Disable full debug symbol generation to speed up CI build and keep memory down | |
# "1" means line tables only, which is useful for panic tracebacks. | |
RUSTFLAGS: "-C debuginfo=1" | |
RUST_BACKTRACE: "1" | |
# according to: https://matklad.github.io/2021/09/04/fast-rust-builds.html | |
# CI builds are faster with incremental disabled. | |
CARGO_INCREMENTAL: "0" | |
CARGO_BUILD_JOBS: "1" | |
jobs: | |
linux-build: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 45 | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
- nightly | |
env: | |
# Need up-to-date compilers for kernels | |
CC: gcc-12 | |
CXX: g++-12 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: rust | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y protobuf-compiler libssl-dev | |
rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} | |
rustup component add rustfmt | |
- name: Run cargo fmt | |
run: cargo fmt --check | |
# split everything us so we know what's slow. | |
- name: Build | |
run: | | |
cargo build --all-features --tests | |
- name: Start DynamoDB local for tests | |
if: ${{ matrix.toolchain == 'stable' }} | |
run: | | |
docker run -d -e AWS_ACCESS_KEY_ID=DUMMYKEY -e AWS_SECRET_ACCESS_KEY=DUMMYKEY -p 8000:8000 amazon/dynamodb-local | |
- name: Run tests | |
if: ${{ matrix.toolchain == 'stable' }} | |
run: | | |
cargo test --features dynamodb,tensorflow,dynamodb_tests,cli | |
- name: Run tests (nightly) | |
if: ${{ matrix.toolchain != 'stable' }} | |
run: | | |
cargo test | |
- name: Build benchmarks | |
if: ${{ matrix.toolchain == 'stable' }} | |
run: cargo build --benches | |
linux-arm: | |
runs-on: buildjet-4vcpu-ubuntu-2204-arm | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: rust | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y protobuf-compiler libssl-dev pkg-config | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
- name: Run cargo fmt | |
run: cargo fmt --check | |
- name: Run tests | |
run: | | |
cargo test --all-features -- --test-threads 1 | |
clippy: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: rust | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y protobuf-compiler libssl-dev | |
- name: Run clippy | |
run: cargo clippy --features cli,dynamodb,tensorflow,dynamodb_tests --tests --benches -- -D warnings | |
mac-build: | |
runs-on: "macos-14" | |
timeout-minutes: 45 | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
- nightly | |
defaults: | |
run: | |
working-directory: ./rust/lance | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: rust | |
- name: Install dependencies | |
run: brew install protobuf | |
- name: Run tests | |
run: | | |
cargo build --all-features | |
cargo test --all-features | |
windows-build: | |
runs-on: windows-latest | |
defaults: | |
run: | |
working-directory: rust/lance | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: rust | |
- name: Install Protoc v21.12 | |
working-directory: C:\ | |
run: | | |
New-Item -Path 'C:\protoc' -ItemType Directory | |
Set-Location C:\protoc | |
Invoke-WebRequest https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-win64.zip -OutFile C:\protoc\protoc.zip | |
7z x protoc.zip | |
Add-Content $env:GITHUB_PATH "C:\protoc\bin" | |
shell: powershell | |
- name: Run tests | |
run: | | |
cargo build | |
cargo test |