-
Notifications
You must be signed in to change notification settings - Fork 21
68 lines (68 loc) · 2.75 KB
/
Copy pathtest_precommit.yml
File metadata and controls
68 lines (68 loc) · 2.75 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
name: test_precommit
permissions: {} # No permissions by default on workflow level
on:
pull_request:
merge_group:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
Python-Functional-Tests:
runs-on: ubuntu-22.04
steps:
- name: CHECKOUT REPOSITORY
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.10"
cache: pip
- name: Create and start a virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Install dependencies
run: |
source venv/bin/activate
python -m pip install --upgrade pip
pip install src/[tests,ovms] --extra-index-url https://download.pytorch.org/whl/cpu
- name: Prepare test data
run: |
source venv/bin/activate
python tests/precommit/prepare_data.py -d data -p tests/precommit/public_scope.json
- name: Run test
run: |
source venv/bin/activate
pytest --data=./data tests/functional
serving_api:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
python-version: ["3.10", "3.11", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- name: Set up docker for macOS
if: startsWith(matrix.os, 'macos-1')
run: |
brew install colima docker
colima start
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: serving_api
run: |
python -m pip install --upgrade pip
python -m pip install src/[ovms,tests]
python tests/precommit/prepare_data.py -d data -p tests/precommit/public_scope.json
python -c "from model_api.models import DetectionModel; DetectionModel.create_model('./data/otx_models/detection_model_with_xai_head.xml').save('ovms_models/ssd_mobilenet_v1_fpn_coco/1/ssd_mobilenet_v1_fpn_coco.xml')"
docker run -d --rm -v $GITHUB_WORKSPACE/ovms_models/:/models -p 8000:8000 openvino/model_server:latest --model_path /models/ssd_mobilenet_v1_fpn_coco/ --model_name ssd_mobilenet_v1_fpn_coco --rest_port 8000 --log_level DEBUG --target_device CPU
python examples/serving_api/run.py data/coco128/images/train2017/000000000009.jpg # detects 4 objects