|
1 | 1 | name: Test Python Examples |
2 | 2 |
|
3 | 3 | on: |
4 | | - # Run on pull requests to main |
| 4 | + # Run on push to bindings/python/ directory |
| 5 | + push: |
| 6 | + paths: |
| 7 | + - 'bindings/python/**' |
| 8 | + - '.github/workflows/test-python-examples.yml' |
| 9 | + |
| 10 | + # Run on pull request affecting bindings/python/ |
5 | 11 | pull_request: |
6 | | - branches: [main] |
| 12 | + paths: |
| 13 | + - 'bindings/python/**' |
| 14 | + - '.github/workflows/test-python-examples.yml' |
| 15 | + |
| 16 | + # Run after release workflow completes |
| 17 | + workflow_run: |
| 18 | + workflows: ["Release"] |
| 19 | + types: [completed] |
7 | 20 |
|
8 | 21 | # Allow being called by other workflows (e.g., release workflow) |
9 | 22 | workflow_call: |
10 | 23 |
|
11 | 24 | # Allow manual trigger |
12 | 25 | workflow_dispatch: |
13 | 26 |
|
| 27 | +permissions: |
| 28 | + contents: read |
| 29 | + |
14 | 30 | jobs: |
15 | 31 | # First job: Download ArcadeDB JARs (platform-agnostic) |
16 | 32 | download-jars: |
@@ -169,15 +185,11 @@ jobs: |
169 | 185 | run: | |
170 | 186 | # Install dependencies needed by examples |
171 | 187 | # Note: macOS Intel needs NumPy 1.x for PyTorch compatibility |
172 | | - # Note: Windows ARM64 doesn't have PyTorch wheels, skip sentence-transformers |
173 | | - if [[ "${{ matrix.platform }}" == "windows/arm64" ]]; then |
174 | | - echo "⚠️ Skipping sentence-transformers on Windows ARM64 (PyTorch not available)" |
175 | | - pip install numpy requests |
176 | | - elif [[ "$OSTYPE" == "darwin"* ]]; then |
| 188 | + if [[ "$OSTYPE" == "darwin"* ]]; then |
177 | 189 | # macOS: Default wheels are CPU/MPS (no CUDA) |
178 | 190 | pip install "numpy<2.0" requests sentence-transformers |
179 | 191 | else |
180 | | - # Linux & Windows x64: Install CPU-only PyTorch to save space (avoid CUDA) |
| 192 | + # Linux & Windows: Install CPU-only PyTorch to save space (avoid CUDA) |
181 | 193 | pip install torch --index-url https://download.pytorch.org/whl/cpu |
182 | 194 | pip install numpy requests sentence-transformers |
183 | 195 | fi |
@@ -247,17 +259,6 @@ jobs: |
247 | 259 | for example in $examples; do |
248 | 260 | total=$((total + 1)) |
249 | 261 |
|
250 | | - # Skip example 06 on Windows ARM64 (PyTorch/sentence-transformers not available) |
251 | | - if [[ "$example" == "06_vector_search_recommendations.py" ]] && [[ "${{ matrix.platform }}" == "windows/arm64" ]]; then |
252 | | - echo "----------------------------------------" |
253 | | - echo "📝 Skipping: $example (PyTorch not available on Windows ARM64)" |
254 | | - echo "----------------------------------------" |
255 | | - echo "⏭️ SKIPPED: $example (PyTorch not available on Windows ARM64)" | tee -a $results_file |
256 | | - skipped=$((skipped + 1)) |
257 | | - echo "" |
258 | | - continue |
259 | | - fi |
260 | | -
|
261 | 262 | # Set example-specific parameters and timeout |
262 | 263 | case "$example" in |
263 | 264 | "04_csv_import_documents.py") |
@@ -393,6 +394,8 @@ jobs: |
393 | 394 | echo " - Tested with \`--dataset movielens-small --parallel 1 --no-async --export --import-jsonl\`" >> $GITHUB_STEP_SUMMARY |
394 | 395 | echo "- **06_vector_search_recommendations.py** - JVector vector indexing for movie recommendations" >> $GITHUB_STEP_SUMMARY |
395 | 396 | echo " - Tested with \`--import-jsonl exports/movielens_graph_small_db.jsonl.tgz\`" >> $GITHUB_STEP_SUMMARY |
| 397 | + echo "- **07_stackoverflow_multimodel.py** - Multi-model graph/document/vector example with StackOverflow data" >> $GITHUB_STEP_SUMMARY |
| 398 | + echo " - Tested with \`--dataset stackoverflow-small\`" >> $GITHUB_STEP_SUMMARY |
396 | 399 | echo "" >> $GITHUB_STEP_SUMMARY |
397 | 400 |
|
398 | 401 | - name: Upload example logs |
|
0 commit comments