usearch 2.7.7 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/.dockerignore +93 -0
  2. package/.github/workflows/Dockerfile.libs +6 -2
  3. package/.github/workflows/prerelease.yml +242 -245
  4. package/.github/workflows/release.yml +390 -356
  5. package/.gitignore +1 -0
  6. package/.vscode/settings.json +3 -1
  7. package/CITATION.cff +1 -1
  8. package/CMakeLists.txt +35 -5
  9. package/Cargo.toml +1 -1
  10. package/README.md +1 -1
  11. package/build.gradle +6 -0
  12. package/c/README.md +3 -3
  13. package/c/lib.cpp +75 -11
  14. package/c/usearch.h +22 -1
  15. package/conanfile.py +1 -1
  16. package/cpp/README.md +2 -1
  17. package/cpp/bench.cpp +3 -0
  18. package/cpp/test.cpp +12 -12
  19. package/csharp/nuget/nuget-package.props +1 -1
  20. package/docs/compilation.md +5 -13
  21. package/golang/lib.go +4 -1
  22. package/include/usearch/index.hpp +31 -30
  23. package/include/usearch/index_dense.hpp +49 -48
  24. package/include/usearch/index_plugins.hpp +70 -8
  25. package/java/cloud/unum/usearch/Index.java +118 -26
  26. package/java/cloud/unum/usearch/cloud_unum_usearch_Index.cpp +8 -8
  27. package/javascript/usearch.js +1 -0
  28. package/objc/USearchObjective.mm +4 -1
  29. package/objc/include/USearchObjective.h +1 -0
  30. package/package.json +1 -1
  31. package/python/lib.cpp +3 -2
  32. package/python/scripts/bench.ipynb +24 -2
  33. package/python/usearch/index.py +8 -3
  34. package/rust/lib.cpp +14 -12
  35. package/rust/lib.hpp +13 -13
  36. package/rust/lib.rs +46 -0
  37. package/setup.py +15 -3
  38. package/simsimd/.github/workflows/prerelease.yml +7 -8
  39. package/simsimd/.github/workflows/release.yml +18 -20
  40. package/simsimd/README.md +13 -8
  41. package/simsimd/binding.gyp +1 -1
  42. package/simsimd/cpp/bench.cxx +17 -3
  43. package/simsimd/include/simsimd/binary.h +1 -3
  44. package/simsimd/include/simsimd/probability.h +234 -361
  45. package/simsimd/include/simsimd/simsimd.h +95 -65
  46. package/simsimd/include/simsimd/spatial.h +0 -3
  47. package/simsimd/include/simsimd/types.h +12 -7
  48. package/simsimd/javascript/test.js +23 -5
  49. package/simsimd/package.json +2 -2
  50. package/wasmer.toml +1 -1
  51. package/wolfram/lib.cpp +1 -1
  52. package/csharp/eng/build_lib.sh +0 -65
  53. package/csharp/eng/clean.sh +0 -12
package/.dockerignore ADDED
@@ -0,0 +1,93 @@
1
+ # Ignore all files without an extension
2
+ *
3
+ !/**/
4
+ !*.*
5
+
6
+ # Temporary files
7
+ .DS_Store
8
+ *.fbin
9
+ *.ibin
10
+ datasets
11
+ bin
12
+ *.usearch
13
+ .cache
14
+
15
+ # C++ builds
16
+ build
17
+ build_release
18
+ build_debug
19
+ _deps
20
+ CMakeCache.txt
21
+ CMakeFiles
22
+ cmake_install.cmake
23
+
24
+ # Profiling with GProf and `perf` on Linux
25
+ gmon.out
26
+ perf.data
27
+
28
+ # Python wrappers
29
+ __pycache__
30
+ *.egg-info
31
+ dist/
32
+ wheelhouse/
33
+
34
+ # Python Environments
35
+ venv/
36
+
37
+ # JS wrappers
38
+ package-lock.json
39
+ node_modules/
40
+
41
+ # Rust builds
42
+ Cargo.lock
43
+ target/
44
+
45
+ # Java bindings
46
+ .gradle
47
+ *.class
48
+
49
+ # ObjC and Swift
50
+ .build
51
+ .swiftpm
52
+
53
+ # C# builds
54
+ csharp/**/[Bb]in/
55
+ csharp/**/[Oo]bj/
56
+ csharp/lib
57
+ csharp/packages
58
+
59
+ # Prerequisites
60
+ *.d
61
+
62
+ # Compiled Object files
63
+ *.slo
64
+ *.lo
65
+ *.o
66
+ *.obj
67
+
68
+ # Precompiled Headers
69
+ *.gch
70
+ *.pch
71
+
72
+ # Compiled Dynamic libraries
73
+ *.so
74
+ *.dylib
75
+ *.dll
76
+
77
+ # Fortran module files
78
+ *.mod
79
+ *.smod
80
+
81
+ # Allow golang go.mod
82
+ !go.mod
83
+
84
+ # Compiled Static libraries
85
+ *.lai
86
+ *.la
87
+ *.a
88
+ *.lib
89
+
90
+ # Executables
91
+ *.exe
92
+ *.out
93
+ *.app
@@ -11,9 +11,13 @@ RUN apt-get update && \
11
11
  apt-get clean && \
12
12
  rm -rf /var/lib/apt/lists/*
13
13
 
14
+ ENV CC=gcc-12
15
+ ENV CXX=g++-12
16
+
14
17
  COPY . .
15
18
 
16
- RUN cd c && make libusearch_c.so
19
+ RUN cmake -DCMAKE_BUILD_TYPE=Release -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_BUILD_TEST_CPP=0 -DUSEARCH_BUILD_BENCH_CPP=0 -B ./build_release
20
+ RUN cmake --build ./build_release --config Release
17
21
 
18
22
  RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
19
23
  export arch="amd"; \
@@ -26,7 +30,7 @@ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
26
30
  mkdir -p usearch_linux_"$arch"_"$version"/usr/local/lib && \
27
31
  mkdir usearch_linux_"$arch"_"$version"/usr/local/include && \
28
32
  cp c/usearch.h usearch_linux_"$arch"_"$version"/usr/local/include/ && \
29
- cp c/libusearch_so.a usearch_linux_"$arch"_"$version"/usr/local/lib/ && \
33
+ cp build_release/libusearch_c.so usearch_linux_"$arch"_"$version"/usr/local/lib/ && \
30
34
  echo "Package: usearch\nVersion: $version\nMaintainer: Ash Vardanian\nArchitecture: "$arch"\nDescription: Faster & Smaller Single-File Search Engine for Vectors & Texts" > usearch_linux_"$arch"_"$version"/DEBIAN/control && \
31
35
  dpkg-deb --build usearch_linux_"$arch"_"$version" && \
32
36
  sshpass -p "$user_pass" scp -o StrictHostKeyChecking=no usearch_linux_"$arch"_"$version".deb "$user_name"@"$docker_ip":/home/$user_name/work/usearch/usearch/
@@ -7,302 +7,299 @@ on:
7
7
  branches: ["main-dev"]
8
8
 
9
9
  env:
10
- BUILD_TYPE: Release
11
10
  GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
12
11
  PYTHONUTF8: 1
12
+ PYTHON_VERSION: 3.11
13
+ DOTNET_VERSION: 7.0.x
13
14
 
14
15
  # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15
16
  permissions:
16
17
  contents: read
17
18
 
18
19
  jobs:
19
-
20
- test_cpp_c_ubuntu_gcc:
21
- name: Test C++ Ubuntu (GCC)
22
- runs-on: ubuntu-latest
23
-
20
+ test_ubuntu_gcc:
21
+ name: Ubuntu (GCC 12)
22
+ runs-on: ubuntu-22.04
23
+ env:
24
+ CC: gcc-12
25
+ CXX: g++-12
26
+
24
27
  steps:
25
- - uses: actions/checkout@v3
26
- with:
27
- ref: main-dev
28
- - run: git submodule update --init --recursive
29
-
30
- - name: Install Dependencies
31
- run: sudo apt update && sudo apt install -y cmake build-essential libjemalloc-dev libomp-dev g++-12
32
-
33
- - name: Build
34
- run: |
35
- export CC=gcc-12
36
- export CXX=g++-12
37
- cmake -B build -DCMAKE_BUILD_TYPE=Debug -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_USE_OPENMP=1 -DUSEARCH_USE_SIMSIMD=1 -DUSEARCH_USE_JEMALLOC=1
38
- cmake --build build --config Debug
39
-
40
- - name: Run C++ tests
41
- run: ./build/test_cpp
42
- - name: Run C tests
43
- run: ./build/test_c
28
+ - uses: actions/checkout@v3
29
+ with:
30
+ ref: main-dev
31
+ - run: git submodule update --init --recursive
44
32
 
33
+ # C/C++
34
+ - name: Build C/C++
35
+ run: |
36
+ sudo apt update
37
+ sudo apt install -y cmake build-essential libjemalloc-dev libomp-dev gcc-12 g++-12
38
+ 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
39
+ cmake --build build_artifacts --config RelWithDebInfo
40
+ - name: Test C++
41
+ run: ./build_artifacts/test_cpp
42
+ - name: Test C
43
+ run: ./build_artifacts/test_c
45
44
 
46
- test_cpp_c_ubuntu_clang:
47
- name: Test C++ Ubuntu (Clang)
48
- runs-on: ubuntu-latest
49
-
50
- steps:
51
- - uses: actions/checkout@v3
52
- with:
53
- ref: main-dev
54
- - run: git submodule update --init --recursive
55
-
56
- - name: Install Dependencies
57
- run: sudo apt update && sudo apt install -y cmake build-essential libjemalloc-dev clang-15
58
-
59
- - name: Build
60
- run: |
61
- export CC=clang-15
62
- export CXX=clang++-15
63
- cmake -B build -DCMAKE_BUILD_TYPE=Debug -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_USE_SIMSIMD=1 -DUSEARCH_USE_JEMALLOC=1
64
- cmake --build build --config Debug
65
-
66
- - name: Run C++ tests
67
- run: ./build/test_cpp
68
- - name: Run C tests
69
- run: ./build/test_c
45
+ # Python
46
+ - name: Set up Python ${{ env.PYTHON_VERSION }}
47
+ uses: actions/setup-python@v4
48
+ with:
49
+ python-version: ${{ env.PYTHON_VERSION }}
50
+ - name: Build Python
51
+ run: |
52
+ python -m pip install --upgrade pip
53
+ pip install pytest numpy
54
+ python -m pip install .
55
+ - name: Test Python
56
+ run: pytest python/scripts/ -s -x
70
57
 
58
+ # JavaScript
59
+ - name: Set up Node.js
60
+ uses: actions/setup-node@v3
61
+ with:
62
+ node-version: 18
63
+ - name: Build JavaScript
64
+ run: npm install
65
+ - name: Test JavaScript
66
+ run: npm ci && npm test
71
67
 
72
- test_cpp_c_macos:
73
- name: Test C++ MacOS
74
- runs-on: macos-latest
75
- steps:
76
- - uses: actions/checkout@v3
77
- with:
78
- ref: main-dev
79
- - run: git submodule update --init --recursive
80
-
81
- - name: Install Dependencies
82
- run: |
83
- brew update
84
- brew install cmake
85
-
86
- - name: Build
87
- run: |
88
- cmake -B build -DCMAKE_BUILD_TYPE=Debug -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1
89
- cmake --build build --config Debug
90
- - name: Run C++ tests
91
- run: ./build/test_cpp
92
- - name: Run C tests
93
- run: ./build/test_c
68
+ # Rust
69
+ - name: Test Rust
70
+ uses: actions-rs/toolchain@v1
71
+ with:
72
+ toolchain: stable
73
+ override: true
94
74
 
95
- test_cpp_c_windows:
96
- name: Test C++ Windows
97
- runs-on: windows-latest
98
- steps:
99
- - uses: actions/checkout@v3
100
- with:
101
- ref: main-dev
102
- - run: git submodule update --init --recursive
103
-
104
- - name: Install Dependencies
105
- run: choco install cmake
106
-
107
- - name: Build
108
- run: |
109
- cmake -B build -DCMAKE_BUILD_TYPE=Debug -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1
110
- cmake --build build --config Debug
111
- - name: Run C++ tests
112
- run: .\build\test_cpp
113
- - name: Run C tests
114
- run: .\build\test_c
115
-
116
- test_python_311:
117
- name: Test Python
118
- runs-on: ${{ matrix.os }}
119
- strategy:
120
- fail-fast: false
121
- matrix:
122
- os: [ubuntu-22.04, macOS-11, windows-2022]
123
- python-version: ["3.11"]
75
+ # Java
76
+ - name: Setup Java
77
+ uses: actions/setup-java@v3
78
+ with:
79
+ java-version: "11"
80
+ distribution: "adopt"
81
+ - name: Setup Gradle
82
+ uses: gradle/gradle-build-action@v2.4.2
83
+ - name: Test Java
84
+ run: gradle clean build
85
+
86
+ # C#
87
+ - name: Setup .NET ${{ env.DOTNET_VERSION }}
88
+ uses: actions/setup-dotnet@v3
89
+ with:
90
+ dotnet-version: ${{ env.DOTNET_VERSION }}
91
+ - name: Test .NET
92
+ run: |
93
+ mkdir -p "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
94
+ cp "${{ github.workspace }}/build_artifacts/libusearch_c.so" "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
95
+ dotnet test -c Release
96
+ shell: bash
97
+ working-directory: ${{ github.workspace }}/csharp
98
+
99
+ # GoLang
100
+ # With `LD_DEBUG=all` we detect the addresses of the libraries that are loaded
101
+ - name: Test GoLang
102
+ run: |
103
+ sudo cp ${{ github.workspace }}/build_artifacts/libusearch_c.so /usr/lib/libusearch_c.so
104
+ sudo cp ${{ github.workspace }}/c/usearch.h /usr/include/usearch.h
105
+ LD_DEBUG=all go test -v
106
+ working-directory: ${{ github.workspace }}/golang/
107
+
108
+ test_ubuntu_clang:
109
+ name: Ubuntu (Clang 16)
110
+ runs-on: ubuntu-22.04
111
+ env:
112
+ CC: clang-16
113
+ CXX: clang++-16
124
114
 
125
115
  steps:
126
116
  - uses: actions/checkout@v3
117
+ with:
118
+ ref: main-dev
127
119
  - run: git submodule update --init --recursive
128
- - name: Set up Python ${{ matrix.python-version }}
120
+
121
+ # C/C++
122
+ # Clang 16 isn't available from default repos on Ubuntu 22.04, so we have to install it manually
123
+ - name: Build C/C++
124
+ run: |
125
+ sudo apt update
126
+ sudo apt install -y cmake build-essential libjemalloc-dev
127
+ wget https://apt.llvm.org/llvm.sh
128
+ chmod +x llvm.sh
129
+ sudo ./llvm.sh 16
130
+ 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
131
+ cmake --build build_artifacts --config RelWithDebInfo
132
+ - name: Test C++
133
+ run: ./build_artifacts/test_cpp
134
+ - name: Test C
135
+ run: ./build_artifacts/test_c
136
+
137
+ # Python
138
+ - name: Set up Python ${{ env.PYTHON_VERSION }}
129
139
  uses: actions/setup-python@v4
130
140
  with:
131
- python-version: ${{ matrix.python-version }}
132
- - name: Install dependencies
141
+ python-version: ${{ env.PYTHON_VERSION }}
142
+ - name: Build Python
133
143
  run: |
134
144
  python -m pip install --upgrade pip
135
145
  pip install pytest numpy
136
- - name: Build locally
137
- run: python -m pip install .
138
- - name: Test with PyTest
146
+ python -m pip install .
147
+ - name: Test Python
139
148
  run: pytest python/scripts/ -s -x
140
149
 
150
+ # JavaScript
151
+ - name: Set up Node.js
152
+ uses: actions/setup-node@v3
153
+ with:
154
+ node-version: 18
155
+ - name: Build and test JavaScript
156
+ run: |
157
+ npm install
158
+ npm ci
159
+ npm test
160
+
161
+ # C#
162
+ - name: Setup .NET ${{ env.DOTNET_VERSION }}
163
+ uses: actions/setup-dotnet@v3
164
+ with:
165
+ dotnet-version: ${{ env.DOTNET_VERSION }}
166
+ - name: Test .NET
167
+ run: |
168
+ mkdir -p "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
169
+ cp "${{ github.workspace }}/build_artifacts/libusearch_c.so" "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
170
+ dotnet test -c Release
171
+ shell: bash
172
+ working-directory: ${{ github.workspace }}/csharp
141
173
 
142
- test_python_37:
143
- name: Test Python 3.7
144
- runs-on: ${{ matrix.os }}
145
- strategy:
146
- fail-fast: false
147
- matrix:
148
- os: [ubuntu-22.04]
149
- python-version: ["3.7"]
174
+ test_macos:
175
+ name: MacOS
176
+ runs-on: macos-12
150
177
 
151
178
  steps:
152
179
  - uses: actions/checkout@v3
180
+ with:
181
+ ref: main-dev
153
182
  - run: git submodule update --init --recursive
154
-
155
- - name: Set up Python ${{ matrix.python-version }}
183
+
184
+ # C/C++
185
+ - name: Build C/C++
186
+ run: |
187
+ brew update
188
+ brew install cmake
189
+ cmake -B build_artifacts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_BUILD_LIB_C=1
190
+ cmake --build build_artifacts --config RelWithDebInfo
191
+ - name: Test C++
192
+ run: ./build_artifacts/test_cpp
193
+ - name: Test C
194
+ run: ./build_artifacts/test_c
195
+
196
+ # Python
197
+ - name: Set up Python ${{ env.PYTHON_VERSION }}
156
198
  uses: actions/setup-python@v4
157
199
  with:
158
- python-version: ${{ matrix.python-version }}
159
-
160
- - name: Install dependencies
200
+ python-version: ${{ env.PYTHON_VERSION }}
201
+ - name: Build Python
161
202
  run: |
162
203
  python -m pip install --upgrade pip
163
204
  pip install pytest numpy
164
-
165
- - name: Build locally
166
- run: python -m pip install .
167
- - name: Test with PyTest
205
+ python -m pip install .
206
+ - name: Test Python
168
207
  run: pytest python/scripts/ -s -x
169
208
 
170
-
171
- test_javascript:
172
- name: Test JavaScript
173
- runs-on: ubuntu-latest
174
- steps:
175
- - uses: actions/checkout@v3
176
- - run: git submodule update --init --recursive
177
- - uses: actions/setup-node@v3
209
+ # JavaScript
210
+ - name: Set up Node.js
211
+ uses: actions/setup-node@v3
178
212
  with:
179
213
  node-version: 18
180
- - run: npm install
181
- - run: npm ci
182
- - run: npm test
214
+ - name: Build JavaScript
215
+ run: npm install
216
+ - name: Test JavaScript
217
+ run: npm ci && npm test
183
218
 
184
- test_rust:
185
- name: Test Rust
186
- runs-on: ubuntu-latest
187
- steps:
188
- - uses: actions/checkout@v3
189
- - run: git submodule update --init --recursive
190
- - uses: actions-rs/toolchain@v1
191
- with:
192
- toolchain: stable
193
- override: true
219
+ # ObjC/Swift
220
+ - name: Build ObjC/Swift
221
+ run: swift build
222
+ - name: Test ObjC/Swift
223
+ run: swift test
194
224
 
195
- test_java:
196
- name: Test Java
197
- runs-on: ubuntu-latest
198
- steps:
199
- - uses: actions/checkout@v3
200
- - run: git submodule update --init --recursive
201
- - uses: actions/setup-java@v3
202
- with:
203
- java-version: '11'
204
- distribution: 'adopt'
205
- - name: Setup Gradle
206
- uses: gradle/gradle-build-action@v2.4.2
207
- - name: Execute Gradle build
208
- run: gradle clean build
209
-
210
- test_swift:
211
- name: Test ObjC & Swift
212
- runs-on: macos-latest
213
- steps:
214
- - uses: actions/checkout@v3
215
- - run: git submodule update --init --recursive
216
- - name: Build
217
- run: swift build
218
- - name: Run tests
219
- run: swift test
225
+ # C#
226
+ - name: Setup .NET ${{ env.DOTNET_VERSION }}
227
+ uses: actions/setup-dotnet@v3
228
+ with:
229
+ dotnet-version: ${{ env.DOTNET_VERSION }}
230
+ - name: Test .NET
231
+ run: |
232
+ mkdir -p "${{ github.workspace }}/csharp/lib/runtimes/osx-x64/native"
233
+ cp "${{ github.workspace }}/build_artifacts/libusearch_c.dylib" "${{ github.workspace }}/csharp/lib/runtimes/osx-x64/native"
234
+ dotnet test -c Release
235
+ shell: bash
236
+ working-directory: ${{ github.workspace }}/csharp
220
237
 
221
- test_csharp:
222
- name: Test C#
223
- runs-on: ${{ matrix.os }}
224
- strategy:
225
- fail-fast: false
226
- matrix:
227
- os: [ubuntu-latest, windows-latest, macos-latest]
228
- dotnet-version: ['7.0.x']
238
+ test_windows:
239
+ name: Windows
240
+ runs-on: windows-2022
229
241
  steps:
230
242
  - uses: actions/checkout@v3
231
- - run: git submodule update --init --recursive
232
- - name: Setup .NET ${{ matrix.dotnet-version }}
233
- uses: actions/setup-dotnet@v3
234
243
  with:
235
- dotnet-version: ${{ matrix.dotnet-version }}
236
-
237
- - name: Ubuntu/macOS build native lib
238
- if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
239
- run: ./build_lib.sh
240
- shell: bash
241
- working-directory: ${{ github.workspace }}/csharp/eng/
244
+ ref: main-dev
245
+ - run: git submodule update --init --recursive
242
246
 
243
- # Use cl.exe https://www.appveyor.com/docs/lang/cpp/#visual-studio-2017
244
- # There is no support for c++11
245
- - name: Windows MSVC build
246
- if: matrix.os == 'windows-latest'
247
+ # C/C++
248
+ - name: Build C/C++
247
249
  run: |
248
- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
249
- where cl
250
- cl /EHsc /std:c++14 /O2 /LD /Fe:libusearch_c.dll lib.cpp /I. /I../include/ /I../fp16/include/
251
- working-directory: ${{ github.workspace }}/c
252
- shell: cmd
250
+ choco install cmake
251
+ cmake -B build_artifacts -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_BUILD_LIB_C=1
252
+ cmake --build build_artifacts --config RelWithDebInfo
253
+ - name: Test C++
254
+ run: .\build_artifacts\test_cpp.exe
255
+ - name: Test C
256
+ run: .\build_artifacts\test_c.exe
253
257
 
254
- - name: Windows move dll to lib dir
255
- if: matrix.os == 'windows-latest'
258
+ # Python
259
+ - name: Set up Python ${{ env.PYTHON_VERSION }}
260
+ uses: actions/setup-python@v4
261
+ with:
262
+ python-version: ${{ env.PYTHON_VERSION }}
263
+ - name: Build Python
256
264
  run: |
257
- mkdir -p "${GITHUB_WORKSPACE}/csharp/lib/runtimes/win-x64/native"
258
- mv "${GITHUB_WORKSPACE}/c/libusearch_c.dll" "${GITHUB_WORKSPACE}/csharp/lib/runtimes/win-x64/native"
259
- shell: bash
260
-
261
- - name: Build and test
262
- run: dotnet test -c Release
263
- shell: bash
264
- working-directory: ${{ github.workspace }}/csharp/
265
-
266
- test_golang:
267
- name: Test Golang
268
- runs-on: ubuntu-latest
269
- steps:
270
- - uses: actions/checkout@v3
271
- with:
272
- persist-credentials: false
273
- ref: 'main-dev'
274
- - run: git submodule update --init --recursive
265
+ python -m pip install --upgrade pip
266
+ pip install pytest numpy
267
+ python -m pip install .
268
+ - name: Test Python
269
+ run: pytest python/scripts/ -s -x
275
270
 
276
- - name: Prepare environment
277
- run: |
278
- sudo apt update &&
279
- sudo apt install -y build-essential
280
-
281
- # This is the weirdest step. GoLang runtime is having a hard time working with our static library...
282
- # And doesn't want to link to the dynamic library... So instead, we rename the `.so` file `.a`, and
283
- # it works just fine.
284
- - name: Build library
285
- run: |
286
- cd golang/
287
- make USEARCH_USE_OPENMP=0 USEARCH_USE_NATIVE_F16=0 USEARCH_USE_SIMSIMD=1 -C ../c libusearch_c.so
288
- sudo cp ../c/libusearch_c.so /usr/local/lib/libusearch_c.a
289
- sudo cp ../c/usearch.h /usr/local/include/usearch.h
271
+ # JavaScript
272
+ - name: Set up Node.js
273
+ uses: actions/setup-node@v3
274
+ with:
275
+ node-version: 18
276
+ - name: Build JavaScript
277
+ run: npm install
278
+ - name: Test JavaScript
279
+ run: npm ci && npm test
290
280
 
291
- - name: Run test
292
- run: |
293
- cd golang
294
- go test -v
295
-
281
+ # C#
282
+ - name: Setup .NET ${{ env.DOTNET_VERSION }}
283
+ uses: actions/setup-dotnet@v3
284
+ with:
285
+ dotnet-version: ${{ env.DOTNET_VERSION }}
286
+ - name: Test .NET
287
+ run: |
288
+ mkdir -p "${{ github.workspace }}\csharp\lib\runtimes\win-x64\native"
289
+ cp "${{ github.workspace }}\build_artifacts\libusearch_c.dll" "${{ github.workspace }}\csharp\lib\runtimes\win-x64\native"
290
+ dotnet test -c Release
291
+ shell: bash
292
+ working-directory: ${{ github.workspace }}/csharp
296
293
 
297
294
  build_docker:
298
- name: Test Docker Image
299
- runs-on: ubuntu-latest
295
+ name: Docker
296
+ runs-on: ubuntu-22.04
300
297
  steps:
301
- - uses: actions/checkout@v3
302
- - run: git submodule update --init --recursive
303
- - name: Build
304
- uses: docker/build-push-action@v4
305
- with:
306
- context: .
307
- load: true
308
- push: false
298
+ - uses: actions/checkout@v3
299
+ - run: git submodule update --init --recursive
300
+ - name: Build
301
+ uses: docker/build-push-action@v4
302
+ with:
303
+ context: .
304
+ load: true
305
+ push: false