Add: Batch add to JS/TS bindings #311
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: Pre-Release | |
on: | |
push: | |
branches: ["main-dev"] | |
pull_request: | |
branches: ["main-dev"] | |
env: | |
BUILD_TYPE: Release | |
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }} | |
PYTHONUTF8: 1 | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
jobs: | |
test_cpp: | |
name: Test C++ | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main-dev | |
- run: git submodule update --init --recursive | |
- name: Prepare Environment | |
run: | | |
sudo apt update && | |
sudo apt install -y cmake g++-12 build-essential libjemalloc-dev | |
- name: Build | |
run: | | |
cmake -B ./build_release \ | |
-DCMAKE_CXX_COMPILER="g++-12" \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DUSEARCH_BUILD_TEST=1 \ | |
-DUSEARCH_USE_OPENMP=1 \ | |
-DUSEARCH_USE_SIMSIMD=1 \ | |
-DUSEARCH_USE_JEMALLOC=1 \ | |
-DUSEARCH_BUILD_BENCHMARK=0 && | |
make -C ./build_release -j | |
- name: Run tests | |
run: ./build_release/test | |
test_python_311: | |
name: Test Python | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, macOS-11, windows-2022] | |
python-version: ["3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- run: git submodule update --init --recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest numpy | |
- name: Build locally | |
run: python -m pip install . | |
- name: Test with PyTest | |
run: pytest python/scripts/test.py | |
test_python_37: | |
name: Test Python 3.7 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04] | |
python-version: ["3.7"] | |
steps: | |
- uses: actions/checkout@v3 | |
- run: git submodule update --init --recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest numpy | |
- name: Build locally | |
run: python -m pip install . | |
- name: Test with PyTest | |
run: pytest python/scripts/test.py | |
test_javascript: | |
name: Test JavaScript | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: git submodule update --init --recursive | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- run: npm install | |
- run: npm ci | |
- run: npm test | |
test_rust: | |
name: Test Rust | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: git submodule update --init --recursive | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
test_java: | |
name: Test Java | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: git submodule update --init --recursive | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
- name: Execute Gradle build | |
run: gradle clean build | |
test_swift: | |
name: Test ObjC & Swift | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: git submodule update --init --recursive | |
- name: Build | |
run: swift build | |
- name: Run tests | |
run: swift test | |
test_wasm: | |
name: Test WASM | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: git submodule update --init --recursive | |
- name: Prepare WASM Environment | |
run: | | |
sudo apt update && | |
sudo apt install -y nodejs | |
git clone https://github.com/emscripten-core/emsdk.git | |
./emsdk/emsdk install latest | |
- name: Build USearch by Emscripten | |
run: | | |
./emsdk/emsdk activate latest && source ./emsdk/emsdk_env.sh | |
emcmake cmake -DUSEARCH_BUILD_BENCHMARK=0 -DUSEARCH_BUILD_WASM=1 -B ./build -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -s TOTAL_MEMORY=64MB" && emmake make -C ./build | |
- name: Run tests | |
run: node ./build/test.js | |
build_docker: | |
name: Test Docker Image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: git submodule update --init --recursive | |
- name: Build | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
load: true | |
push: false |