Skip to content

feat(rust/sedona-spatial-join): Support spatial partitioned spatial join for non-knn predicates #1696

feat(rust/sedona-spatial-join): Support spatial partitioned spatial join for non-knn predicates

feat(rust/sedona-spatial-join): Support spatial partitioned spatial join for non-knn predicates #1696

Workflow file for this run

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: rust
on:
pull_request:
branches:
- main
paths:
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/rust.yml'
- 'rust/**'
- 'c/**'
push:
branches:
- main
concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}-rust
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
shell: bash -l -eo pipefail {0}
env:
# At GEOS updated to 3.14.0
VCPKG_REF: 5a01de756c28279ddfdd2b061d1c75710a6255fa
jobs:
rust:
strategy:
fail-fast: false
matrix:
name: ["clippy", "docs", "test", "build", "fmt"]
name: "${{ matrix.name }}"
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0
# Reduce debug info to save disk space
CARGO_PROFILE_DEV_DEBUG: 1
CARGO_PROFILE_TEST_DEBUG: 1
# Limit parallel compilation to reduce memory pressure
CARGO_BUILD_JOBS: 2
steps:
- uses: actions/checkout@v6
with:
submodules: 'true'
- name: Clone vcpkg
uses: actions/checkout@v6
with:
repository: microsoft/vcpkg
ref: ${{ env.VCPKG_REF }}
path: vcpkg
- name: Set up environment variables and bootstrap vcpkg
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
run: |
cd vcpkg
./bootstrap-vcpkg.sh
cd ..
echo "VCPKG_ROOT=$VCPKG_ROOT" >> $GITHUB_ENV
echo "PATH=$VCPKG_ROOT:$PATH" >> $GITHUB_ENV
echo "CMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE" >> $GITHUB_ENV
- name: Cache vcpkg binaries
id: cache-vcpkg
uses: actions/cache@v5
with:
path: vcpkg/packages
# Bump the number at the end of this line to force a new dependency build
key: vcpkg-installed-${{ runner.os }}-${{ runner.arch }}-${{ env.VCPKG_REF }}-3
- name: Install vcpkg dependencies
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
run: |
./vcpkg/vcpkg install abseil openssl
# Clean up vcpkg buildtrees and downloads to save space
rm -rf vcpkg/buildtrees
rm -rf vcpkg/downloads
- name: Use stable Rust
id: rust
run: |
rustup toolchain install stable --no-self-update
rustup default stable
- uses: Swatinem/rust-cache@v2
with:
# Update this key to force a new cache
prefix-key: "rust-${{ matrix.name }}-v5"
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# Free up space by removing tools we don't need
tool-cache: false # Keep tool cache as we need build tools
android: true # Remove Android SDK (not needed)
dotnet: true # Remove .NET runtime (not needed)
haskell: true # Remove Haskell toolchain (not needed)
large-packages: false # Keep essential packages including build-essential
swap-storage: true # Remove swap file to free space
docker-images: true # Remove docker images (not needed)
- name: Install dependencies
shell: bash
run: |
sudo apt-get update && sudo apt-get install -y libgeos-dev
- name: Build
if: matrix.name == 'build'
run: |
cargo build --workspace --all-targets --all-features
# Clean up build artifacts aggressively
rm -rf target/debug/deps
rm -rf target/debug/incremental
rm -rf target/debug/build
- name: Clippy
if: matrix.name == 'clippy'
run: |
cargo clippy --workspace --all-targets --all-features -- -Dwarnings
# Clean up clippy artifacts aggressively
rm -rf target/debug/deps
rm -rf target/debug/incremental
rm -rf target/debug/build
- name: Test
if: matrix.name == 'test'
run: |
cargo test --workspace --all-targets --all-features
# Clean up intermediate build artifacts to free disk space aggressively
cargo clean -p sedona-s2geography
rm -rf target/debug/deps
rm -rf target/debug/incremental
rm -rf target/debug/build
# Also clean target/.rustc_info.json and other cache files
find target/debug -name "*.rlib" -delete
find target/debug -name "*.rmeta" -delete
- name: Doctests
if: matrix.name == 'test'
run: |
cargo test --workspace --doc --all-features
# Clean up after doctests
cargo clean
- name: Check docs
if: matrix.name == 'docs'
run: |
# Generate docs with reduced parallelism to avoid memory issues
cargo doc --workspace --all-features -j 2
- name: Format
if: matrix.name == 'fmt'
run: cargo fmt --all -- --check