forked from lancedb/vectordb-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (133 loc) · 3.5 KB
/
examples-test.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
name: Examples Code Test
on:
push:
branches:
- main
paths:
- examples/**
- .github/workflows/examples-test.yml
- compile_testing.py
- compile_testing.js
pull_request:
paths:
- examples/**
- .github/workflows/examples-test.yml
- compile_testing.py
- compile_testing.js
workflow_dispatch:
repository_dispatch:
jobs:
test-python:
name: Test python examples
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "11" ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
sudo apt-get install unzip
- name: Run tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
working-directory: examples
run: |
for folder in *; do
echo "$folder";
if [[ $folder == multimodal_clip ]]; then
continue
fi
if [ ! -f "$folder"/test.py ]; then
continue
fi
cd "$folder"
for file in *; do
echo "$file";
if [[ $file == requirements.txt ]]; then
echo "$file";
python -m pip install -r "$file";
pip uninstall lancedb -y
pip install "lancedb @ git+https://github.com/lancedb/lancedb.git#egg=subdir&subdirectory=python"
fi
done
for file in *; do
if [[ $file == test.py ]]; then
echo "$file";
pytest "$file";
fi
done
cd ..
done
test-node:
name: Test node examples
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ "18" ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- uses: actions/checkout@v3
with:
repository: lancedb/lancedb
path: './lancedb'
ref: main
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y protobuf-compiler libssl-dev
npm install -g package-json-merge
- name: Build LanceDB
working-directory: lancedb/node
run: |
npm ci
npm run tsc
npm pack
- name: Run compile_testing.js
run: |
node compile_testing.js
- name: Create files
working-directory: testing-folder
run: |
bash merge-package.sh
iconv -f UTF-8 -t UTF-8 temp.json > package.json
cat package.json
npm install
npm uninstall vectordb
- name: Install LanceDB
working-directory: testing-folder
run: |
for d in ../lancedb/node/*; do
if [[ $d == *.tgz ]]; then
echo "$d";
npm install "$d";
fi
done
- name: Download datasets
working-directory: testing-folder
run: bash commands.sh
- name: Run tests
working-directory: testing-folder
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
for d in *; do
if [[ $d == *.js ]]; then
echo "$d";
node "$d";
fi
done