Skip to content

Make: Forward SimSIMD settings #653

Make: Forward SimSIMD settings

Make: Forward SimSIMD settings #653

Workflow file for this run

name: Pre-Release
on:
push:
branches: ["main-dev"]
pull_request:
branches: ["main-dev"]
env:
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
PYTHONUTF8: 1
PYTHON_VERSION: 3.11
DOTNET_VERSION: 7.0.x
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
jobs:
test_ubuntu_gcc:
name: Ubuntu (GCC 12)
runs-on: ubuntu-22.04
env:
CC: gcc-12
CXX: g++-12
steps:
- uses: actions/checkout@v3
with:
ref: main-dev
- run: git submodule update --init --recursive
# C/C++
- name: Build C/C++
run: |
sudo apt update
sudo apt install -y cmake build-essential libjemalloc-dev libomp-dev gcc-12 g++-12
cmake -B build_artifacts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_USE_OPENMP=1 -DUSEARCH_USE_SIMSIMD=1 -DUSEARCH_USE_JEMALLOC=1
cmake --build build_artifacts --config RelWithDebInfo
- name: Test C++
run: ./build_artifacts/test_cpp
- name: Test C
run: ./build_artifacts/test_c
# Python
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Build Python
run: |
python -m pip install --upgrade pip
pip install pytest numpy
python -m pip install .
- name: Test Python
run: pytest python/scripts/ -s -x
# JavaScript
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Build JavaScript
run: npm install
- name: Test JavaScript
run: npm ci && npm test
# Rust
- name: Test Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
# Java
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "adopt"
- name: Setup Gradle
uses: gradle/[email protected]
- name: Test Java
run: gradle clean build
# C#
- name: Setup .NET ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Test .NET
run: |
mkdir -p "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
cp "${{ github.workspace }}/build_artifacts/libusearch_c.so" "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
dotnet test -c Release
shell: bash
working-directory: ${{ github.workspace }}/csharp
# GoLang
# With `LD_DEBUG=all` we detect the addresses of the libraries that are loaded
- name: Test GoLang
run: |
sudo cp ${{ github.workspace }}/build_artifacts/libusearch_c.so /usr/lib/libusearch_c.so
sudo cp ${{ github.workspace }}/c/usearch.h /usr/include/usearch.h
LD_DEBUG=all go test -v
working-directory: ${{ github.workspace }}/golang/
test_ubuntu_clang:
name: Ubuntu (Clang 16)
runs-on: ubuntu-22.04
env:
CC: clang-16
CXX: clang++-16
steps:
- uses: actions/checkout@v3
with:
ref: main-dev
- run: git submodule update --init --recursive
# C/C++
# Clang 16 isn't available from default repos on Ubuntu 22.04, so we have to install it manually
- name: Build C/C++
run: |
sudo apt update
sudo apt install -y cmake build-essential libjemalloc-dev
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16
cmake -B build_artifacts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_BUILD_LIB_C=1 -DDUSEARCH_USE_OPENMP=0 -DUSEARCH_USE_SIMSIMD=1 -DUSEARCH_USE_JEMALLOC=1
cmake --build build_artifacts --config RelWithDebInfo
- name: Test C++
run: ./build_artifacts/test_cpp
- name: Test C
run: ./build_artifacts/test_c
# Python
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Build Python
run: |
python -m pip install --upgrade pip
pip install pytest numpy
python -m pip install .
- name: Test Python
run: pytest python/scripts/ -s -x
# JavaScript
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Build and test JavaScript
run: |
npm install
npm ci
npm test
# C#
- name: Setup .NET ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Test .NET
run: |
mkdir -p "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
cp "${{ github.workspace }}/build_artifacts/libusearch_c.so" "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
dotnet test -c Release
shell: bash
working-directory: ${{ github.workspace }}/csharp
test_macos:
name: MacOS
runs-on: macos-12
steps:
- uses: actions/checkout@v3
with:
ref: main-dev
- run: git submodule update --init --recursive
# C/C++
- name: Build C/C++
run: |
brew update
brew install cmake
cmake -B build_artifacts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_BUILD_LIB_C=1
cmake --build build_artifacts --config RelWithDebInfo
- name: Test C++
run: ./build_artifacts/test_cpp
- name: Test C
run: ./build_artifacts/test_c
# Python
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Build Python
run: |
python -m pip install --upgrade pip
pip install pytest numpy
python -m pip install .
- name: Test Python
run: pytest python/scripts/ -s -x
# JavaScript
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Build JavaScript
run: npm install
- name: Test JavaScript
run: npm ci && npm test
# ObjC/Swift
- name: Build ObjC/Swift
run: swift build
- name: Test ObjC/Swift
run: swift test
# C#
- name: Setup .NET ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Test .NET
run: |
mkdir -p "${{ github.workspace }}/csharp/lib/runtimes/osx-x64/native"
cp "${{ github.workspace }}/build_artifacts/libusearch_c.dylib" "${{ github.workspace }}/csharp/lib/runtimes/osx-x64/native"
dotnet test -c Release
shell: bash
working-directory: ${{ github.workspace }}/csharp
test_windows:
name: Windows
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
ref: main-dev
- run: git submodule update --init --recursive
# C/C++
- name: Build C/C++
run: |
choco install cmake
cmake -B build_artifacts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_BUILD_LIB_C=1
cmake --build build_artifacts --config RelWithDebInfo
- name: Test C++
run: .\build_artifacts\test_cpp.exe
- name: Test C
run: .\build_artifacts\test_c.exe
# Python
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Build Python
run: |
python -m pip install --upgrade pip
pip install pytest numpy
python -m pip install .
- name: Test Python
run: pytest python/scripts/ -s -x
# JavaScript
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Build JavaScript
run: npm install
- name: Test JavaScript
run: npm ci && npm test
# C#
- name: Setup .NET ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Test .NET
run: |
mkdir -p "${{ github.workspace }}\csharp\lib\runtimes\win-x64\native"
cp "${{ github.workspace }}\build_artifacts\libusearch_c.dll" "${{ github.workspace }}\csharp\lib\runtimes\win-x64\native"
dotnet test -c Release
shell: bash
working-directory: ${{ github.workspace }}/csharp
build_docker:
name: Docker
runs-on: ubuntu-22.04
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