Support adding vector index to the Database Model #292
Workflow file for this run
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
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox | |
- name: Run lint | |
run: | | |
tox -e lint | |
tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- '3.10' | |
- '3.11' | |
# blocked by https://github.com/lericson/pylibmc/issues/288 | |
# - '3.12' | |
django-version: | |
- '5.0.4' | |
tidb-version: | |
- 'v8.1.0' | |
- 'v7.5.1' | |
- 'v7.1.4' | |
- 'v6.5.8' | |
- 'v5.4.3' | |
exclude: | |
# Django introduced the `debug_transaction` feature in version 4.2.x, | |
# but it does not consider databases that do not support savepoints(TiDB < 6.2.0), | |
# as a result, all `assertNumQueries` in test cases failed. | |
# https://github.com/django/django/commit/798e38c2b9c46ab72e2ee8c33dc822f01b194b1e | |
- django-version: '5.0.4' | |
tidb-version: 'v5.4.3' | |
name: py${{ matrix.python-version }}_tidb${{ matrix.tidb-version }}_django${{ matrix.django-version }} | |
runs-on: ubuntu-latest | |
services: | |
tidb: | |
image: wangdi4zm/tind:${{ matrix.tidb-version }}-standalone | |
ports: | |
- 4000:4000 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox tox-gh-actions | |
sudo apt-get update | |
sudo apt-get install -y libmemcached-dev zlib1g-dev | |
- name: Run tests | |
run: tox | |
env: | |
DJANGO_VERSION: ${{ matrix.django-version }} | |
vector-tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- '3.11' | |
django-version: | |
- '5.0.4' | |
name: vector-py${{ matrix.python-version }}_django${{ matrix.django-version }} | |
runs-on: ubuntu-latest | |
services: | |
tidb: | |
image: wangdi4zm/tind:v8.4.0-vector-index | |
ports: | |
- 4000:4000 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox tox-gh-actions | |
sudo apt-get update | |
sudo apt-get install -y libmemcached-dev zlib1g-dev | |
- name: Hack for vector tests | |
run: | | |
sed '27a cp -r ./tests/tidb_vector/ $DJANGO_TESTS_DIR/django/tests/tidb_vector/' -i django_test_suite.sh | |
sed '31a pip install numpy~=1.0' -i django_test_suite.sh | |
cat django_test_suite.sh | |
echo -n "tidb_vector" > django_test_apps.txt | |
cat django_test_apps.txt | |
- name: Run tests | |
run: tox | |
env: | |
DJANGO_VERSION: ${{ matrix.django-version }} |