blob: 81e421c8f53f3d4593e7a8ebd25627e6e786550d [file]
# 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: CI
on:
push:
branches:
- main
- release-*
pull_request:
branches:
- main
- release-*
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate .asf.yaml
run: pip install pyyaml -q && python3 tools/validate_asf_yaml.py
- name: Install cargo-deny
uses: taiki-e/install-action@v2
with:
tool: cargo-deny@0.19.0
- name: Check dependency licenses (Apache-compatible)
run: cargo deny check licenses
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --workspace -- -D warnings
rust-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Rust Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build
run: cargo build --all-targets
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Test with coverage
run: cargo llvm-cov --workspace --summary-only
jni-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Rust Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
- name: Test Java API
run: |
mkdir -p target/java-api-test
javac -source 8 -target 8 -d target/java-api-test $(find jni/java jni/java-test -name '*.java')
java -cp target/java-api-test org.apache.paimon.index.ivfpq.IVFPQJavaApiTest
- name: Build JNI library
run: cargo build -p paimon-vindex-jni --release
python-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Rust Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Python build/test dependencies
run: pip install maturin numpy
- name: Test Python API
run: cargo test --manifest-path python/Cargo.toml --no-default-features --features auto-initialize
- name: Build Python module
working-directory: python
run: maturin build --release