1
- # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3
- name : Precommit - Test
4
-
5
- on :
6
- push :
7
- branches : [ master ]
8
- pull_request :
9
- branches : [ master ]
10
-
1
+ name : test_precommit
2
+ on : pull_request
11
3
concurrency :
12
4
group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13
5
cancel-in-progress : true
14
-
15
6
jobs :
16
7
Python-Code-Quality :
17
- strategy :
18
- fail-fast : false
19
- matrix :
20
- python-version : [3.8]
21
-
22
8
runs-on : ubuntu-latest
23
9
steps :
24
- - uses : actions/checkout@v2
10
+ - uses : actions/checkout@v3
25
11
- name : git --no-pager diff --check $(git hash-object -t tree /dev/null)
26
12
run : git --no-pager diff --check $(git hash-object -t tree /dev/null)
27
13
- name : Prohibit non ASCII chars in file names
28
14
run : test $(git diff --name-only --diff-filter=A -z $(git hash-object -t tree /dev/null) | LC_ALL=C tr -d '[ -~]\0' | wc -c) == 0
29
15
- name : " ! git grep -n '[^ -~]' -- ':(exclude)model_api/python/openvino/model_api/README.md'"
30
16
run : " ! git grep -n '[^ -~]' -- ':(exclude)model_api/python/openvino/model_api/README.md'"
31
- - name : Setup Python ${{ matrix.python-version }}
32
- uses : actions/setup-python@v2
17
+ - uses : actions/setup-python@v4
33
18
with :
34
- python-version : ${{ matrix.python-version }}
19
+ python-version : 3.8
20
+ cache : pip
35
21
- name : Create and start a virtual environment
36
22
run : |
37
23
python -m venv venv
40
26
run : |
41
27
source venv/bin/activate
42
28
pip install --upgrade pip
43
- pip install isort
44
- pip install black
29
+ pip install isort black
45
30
- name : Check style with black
46
31
run : |
47
32
source venv/bin/activate
@@ -51,18 +36,13 @@ jobs:
51
36
source venv/bin/activate
52
37
isort --check .
53
38
Python-Precommit :
54
- strategy :
55
- fail-fast : false
56
- matrix :
57
- python-version : [3.8]
58
-
59
39
runs-on : ubuntu-latest
60
40
steps :
61
- - uses : actions/checkout@v2
62
- - name : Setup Python ${{ matrix.python-version }}
63
- uses : actions/setup-python@v2
41
+ - uses : actions/checkout@v3
42
+ - uses : actions/setup-python@v4
64
43
with :
65
- python-version : ${{ matrix.python-version }}
44
+ python-version : 3.8
45
+ cache : pip
66
46
- name : Create and start a virtual environment
67
47
run : |
68
48
python -m venv venv
@@ -80,27 +60,21 @@ jobs:
80
60
name : CPP-Code-Quality
81
61
runs-on : ubuntu-latest
82
62
steps :
83
- - uses : actions/checkout@v2
84
-
63
+ - uses : actions/checkout@v3
85
64
- name : cppcheck
86
65
uses : chmorgan/cppcheck-action@main
87
66
with :
88
67
github_token : ${{ secrets.GITHUB_TOKEN}}
89
68
# missingInclude: cppcheck can't find stl, openvino, opencv
90
69
other_options : --suppress=missingInclude -Imodel_api/cpp/models/include -Imodel_api/cpp/utils/include -Imodel_api/cpp/pipelines/include --check-config
91
70
CPP-Precommit :
92
- strategy :
93
- fail-fast : false
94
- matrix :
95
- python-version : [3.8]
96
-
97
71
runs-on : ubuntu-latest
98
72
steps :
99
- - uses : actions/checkout@v2
100
- - name : Setup Python ${{ matrix.python-version }}
101
- uses : actions/setup-python@v2
73
+ - uses : actions/checkout@v3
74
+ - uses : actions/setup-python@v4
102
75
with :
103
- python-version : ${{ matrix.python-version }}
76
+ python-version : 3.8
77
+ cache : pip
104
78
- name : Create and start a virtual environment
105
79
run : |
106
80
python -m venv venv
@@ -125,18 +99,13 @@ jobs:
125
99
run : |
126
100
build/test_sanity -d data -p tests/cpp/precommit/public_scope.json && build/test_model_config -d data
127
101
CPP-Windows-Precommit :
128
- strategy :
129
- fail-fast : false
130
- matrix :
131
- python-version : [3.8]
132
-
133
102
runs-on : windows-latest
134
103
steps :
135
- - uses : actions/checkout@v2
136
- - name : Setup Python ${{ matrix.python-version }}
137
- uses : actions/setup-python@v2
104
+ - uses : actions/checkout@v3
105
+ - uses : actions/setup-python@v4
138
106
with :
139
- python-version : ${{ matrix.python-version }}
107
+ python-version : 3.8
108
+ cache : pip
140
109
- name : Create and start a virtual environment
141
110
shell : bash
142
111
run : |
@@ -171,24 +140,44 @@ jobs:
171
140
set PATH=opencv\opencv\build\x64\vc16\bin;w_openvino_toolkit_windows_2023.0.0.10926.b4452d56304_x86_64\runtime\bin\intel64\Release;w_openvino_toolkit_windows_2023.0.0.10926.b4452d56304_x86_64\runtime\3rdparty\tbb\bin;%PATH%
172
141
.\build\Release\test_sanity.exe -d data -p tests\cpp\precommit\public_scope.json && .\build\Release\test_model_config -d data
173
142
serving_api :
174
- strategy :
175
- fail-fast : false
176
- matrix :
177
- python-version : [3.7, 3.8, 3.9, '3.10', '3.11']
178
- os : [ubuntu-20.04, ubuntu-latest]
179
-
180
- runs-on : ${{ matrix.os }}
181
- steps :
182
- - uses : actions/checkout@v2
183
- - name : Setup Python ${{ matrix.python-version }}
184
- uses : actions/setup-python@v2
185
- with :
186
- python-version : ${{ matrix.python-version }}
187
- - name : serving_api
188
- run : |
189
- python -m pip install --upgrade pip
190
- python -m pip install model_api/python/[ovms,tests]
191
- python -c "from openvino.model_api.models import DetectionModel; DetectionModel.create_model('ssd_mobilenet_v1_fpn_coco').save('ovms_models/ssd_mobilenet_v1_fpn_coco/1/ssd_mobilenet_v1_fpn_coco.xml')"
192
- docker run -d --rm -v $GITHUB_WORKSPACE/ovms_models/:/models -p 9000:9000 -p 8000:8000 openvino/model_server:latest --model_path /models/ssd_mobilenet_v1_fpn_coco/ --model_name ssd_mobilenet_v1_fpn_coco --port 9000 --rest_port 8000 --log_level DEBUG --target_device CPU
193
- python tests/cpp/precommit/prepare_data.py -d data -p tests/cpp/precommit/public_scope.json
194
- python examples/python/serving_api/run.py data/coco128/images/train2017/000000000009.jpg # detects 4 objects
143
+ strategy :
144
+ fail-fast : false
145
+ matrix :
146
+ os : [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12]
147
+ python-version : [3.7, 3.8, 3.9, '3.10', '3.11']
148
+ exclude :
149
+ # Maximum concurrent macOS jobs is 5
150
+ - os : macos-11
151
+ python-version : 3.8
152
+ - os : macos-11
153
+ python-version : 3.9
154
+ - os : macos-11
155
+ python-version : ' 3.10'
156
+ - os : macos-12
157
+ python-version : 3.9
158
+ - os : macos-12
159
+ python-version : ' 3.10'
160
+ runs-on : ${{ matrix.os }}
161
+ steps :
162
+ - name : Set up docker for macOS
163
+ if : startsWith(matrix.os, 'macos-1')
164
+ run : |
165
+ brew install docker
166
+ # TODO: remove qemu reinstallation after https://github.com/actions/runner-images/issues/8104 is resolved
167
+ brew remove --ignore-dependencies qemu
168
+ curl -o qemu.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/f88e30b3a23ef3735580f9b05535ce5a0a03c9e3/Formula/qemu.rb
169
+ brew install qemu.rb
170
+ colima start
171
+ - uses : actions/checkout@v3
172
+ - uses : actions/setup-python@v4
173
+ with :
174
+ python-version : ${{ matrix.python-version }}
175
+ cache : pip
176
+ - name : serving_api
177
+ run : |
178
+ python -m pip install --upgrade pip
179
+ python -m pip install model_api/python/[ovms,tests]
180
+ python -c "from openvino.model_api.models import DetectionModel; DetectionModel.create_model('ssd_mobilenet_v1_fpn_coco').save('ovms_models/ssd_mobilenet_v1_fpn_coco/1/ssd_mobilenet_v1_fpn_coco.xml')"
181
+ docker run -d --rm -v $GITHUB_WORKSPACE/ovms_models/:/models -p 9000:9000 -p 8000:8000 openvino/model_server:latest --model_path /models/ssd_mobilenet_v1_fpn_coco/ --model_name ssd_mobilenet_v1_fpn_coco --port 9000 --rest_port 8000 --log_level DEBUG --target_device CPU
182
+ python tests/cpp/precommit/prepare_data.py -d data -p tests/cpp/precommit/public_scope.json
183
+ python examples/python/serving_api/run.py data/coco128/images/train2017/000000000009.jpg # detects 4 objects
0 commit comments