Repository navigation
74 lines (60 loc) · 2.26 KB
/
Copy pathvector-search-python-ci.yml
File metadata and controls
74 lines (60 loc) · 2.26 KB
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
# CI for the Azure SQL Vector Search Python quickstart sample.
# Security: uses `pull_request` (read-only token, no secrets on forks)
# with an explicit same-repo check to skip fork PRs entirely.
#
# This CI runs static analysis and unit tests only — no live Azure SQL
# Database or Azure OpenAI resource is required or contacted. Live
# end-to-end validation is a separate, manual step (see the sample's
# README and output/sample-output.txt for the explicit no-live-run
# disclosure).
name: "Vector Search Python — Build"
on:
pull_request:
branches: [master]
paths:
- "samples/features/vector-search/vector-search-query-python/**"
push:
branches: [master]
paths:
- "samples/features/vector-search/vector-search-query-python/**"
# Cancel redundant runs for the same PR / branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Lint, type-check, and test
runs-on: ubuntu-latest
timeout-minutes: 10
# Skip CI on fork PRs — prevents external actors from consuming minutes.
if: >-
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
defaults:
run:
working-directory: samples/features/vector-search/vector-search-query-python
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: |
samples/features/vector-search/vector-search-query-python/requirements.txt
samples/features/vector-search/vector-search-query-python/requirements-dev.txt
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Lint
run: python -m ruff check .
- name: Format check
run: python -m ruff format --check .
- name: Type-check
run: python -m mypy src
- name: Unit tests (no Azure connectivity required)
run: python -m pytest -v