-
Notifications
You must be signed in to change notification settings - Fork 139
181 lines (159 loc) · 4.6 KB
/
prerelease.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
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 using 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