feat: ef per query and py12 wheel #6
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: Test | |
on: | |
workflow_call: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test_python: | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Build and install | |
run: python -m pip install . | |
- name: Test | |
timeout-minutes: 15 | |
run: | | |
output=$(python -m unittest discover -v --start-directory examples/python --pattern "example*.py" 2>&1) | |
echo "$output" | |
if [[ "$output" == *"NO TESTS RAN"* ]]; then | |
# Exit with status 0 if no tests ran | |
exit 0 | |
else | |
# Otherwise, exit with the original exit status of the unittest command | |
exit $? | |
fi | |
python -m unittest discover -v --start-directory tests/python --pattern "bindings_test*.py" | |
test_cpp: | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Build | |
run: | | |
mkdir build | |
cd build | |
cmake .. | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
make | |
elif [ "$RUNNER_OS" == "Windows" ]; then | |
cmake --build ./ --config Release | |
fi | |
shell: bash | |
- name: Prepare test data | |
run: | | |
pip install numpy | |
cd tests/cpp/ | |
python update_gen_data.py | |
shell: bash | |
- name: Test | |
timeout-minutes: 15 | |
run: | | |
cd build | |
if [ "$RUNNER_OS" == "Windows" ]; then | |
cp ./Release/* ./ | |
fi | |
./example_search | |
./example_filter | |
./example_replace_deleted | |
./example_mt_search | |
./example_mt_filter | |
./example_mt_replace_deleted | |
./searchKnnCloserFirst_test | |
./searchKnnWithFilter_test | |
./multiThreadLoad_test | |
./multiThread_replace_test | |
./getUnormalized_test | |
./test_updates | |
./test_updates update | |
./persistent_test | |
shell: bash |