Skip to content

Commit 3ebe7ac

Browse files
authored
Update workflows (#84)
1. Remove running on `schedule`: don't generate extra entry in `Actions` tab of the repo, we run all checks on `pull_request` anyway 1. Run checks for all `pull_request`, not only for `master` 1. Use `cache: pip` 1. Enable macOS test
1 parent 368f2a3 commit 3ebe7ac

File tree

2 files changed

+68
-93
lines changed

2 files changed

+68
-93
lines changed

.github/workflows/test_accuracy.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,17 @@
1-
name: Test - Accuracy
2-
3-
on:
4-
workflow_dispatch:
5-
schedule:
6-
- cron: '11 1 * * *' # run every day at 1:11
7-
pull_request:
8-
branches: [ master ]
9-
1+
name: test_accuracy
2+
on: pull_request
103
concurrency:
114
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
125
cancel-in-progress: true
13-
146
jobs:
157
test_accuracy:
16-
strategy:
17-
fail-fast: false
18-
matrix:
19-
python-version: [3.8]
20-
os: [ubuntu-latest]
21-
22-
runs-on: ${{ matrix.os }}
8+
runs-on: ubuntu-latest
239
steps:
24-
- uses: actions/checkout@v2
25-
- name: Setup Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v2
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-python@v4
2712
with:
28-
python-version: ${{ matrix.python-version }}
13+
python-version: 3.8
14+
cache: pip
2915
- name: Create and start a virtual environment
3016
run: |
3117
python -m venv venv

.github/workflows/test_precommit.yml

Lines changed: 61 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,23 @@
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
113
concurrency:
124
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
135
cancel-in-progress: true
14-
156
jobs:
167
Python-Code-Quality:
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
python-version: [3.8]
21-
228
runs-on: ubuntu-latest
239
steps:
24-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
2511
- name: git --no-pager diff --check $(git hash-object -t tree /dev/null)
2612
run: git --no-pager diff --check $(git hash-object -t tree /dev/null)
2713
- name: Prohibit non ASCII chars in file names
2814
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
2915
- name: "! git grep -n '[^ -~]' -- ':(exclude)model_api/python/openvino/model_api/README.md'"
3016
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
3318
with:
34-
python-version: ${{ matrix.python-version }}
19+
python-version: 3.8
20+
cache: pip
3521
- name: Create and start a virtual environment
3622
run: |
3723
python -m venv venv
@@ -40,8 +26,7 @@ jobs:
4026
run: |
4127
source venv/bin/activate
4228
pip install --upgrade pip
43-
pip install isort
44-
pip install black
29+
pip install isort black
4530
- name: Check style with black
4631
run: |
4732
source venv/bin/activate
@@ -51,18 +36,13 @@ jobs:
5136
source venv/bin/activate
5237
isort --check .
5338
Python-Precommit:
54-
strategy:
55-
fail-fast: false
56-
matrix:
57-
python-version: [3.8]
58-
5939
runs-on: ubuntu-latest
6040
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
6443
with:
65-
python-version: ${{ matrix.python-version }}
44+
python-version: 3.8
45+
cache: pip
6646
- name: Create and start a virtual environment
6747
run: |
6848
python -m venv venv
@@ -80,27 +60,21 @@ jobs:
8060
name: CPP-Code-Quality
8161
runs-on: ubuntu-latest
8262
steps:
83-
- uses: actions/checkout@v2
84-
63+
- uses: actions/checkout@v3
8564
- name: cppcheck
8665
uses: chmorgan/cppcheck-action@main
8766
with:
8867
github_token: ${{ secrets.GITHUB_TOKEN}}
8968
# missingInclude: cppcheck can't find stl, openvino, opencv
9069
other_options: --suppress=missingInclude -Imodel_api/cpp/models/include -Imodel_api/cpp/utils/include -Imodel_api/cpp/pipelines/include --check-config
9170
CPP-Precommit:
92-
strategy:
93-
fail-fast: false
94-
matrix:
95-
python-version: [3.8]
96-
9771
runs-on: ubuntu-latest
9872
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
10275
with:
103-
python-version: ${{ matrix.python-version }}
76+
python-version: 3.8
77+
cache: pip
10478
- name: Create and start a virtual environment
10579
run: |
10680
python -m venv venv
@@ -125,18 +99,13 @@ jobs:
12599
run: |
126100
build/test_sanity -d data -p tests/cpp/precommit/public_scope.json && build/test_model_config -d data
127101
CPP-Windows-Precommit:
128-
strategy:
129-
fail-fast: false
130-
matrix:
131-
python-version: [3.8]
132-
133102
runs-on: windows-latest
134103
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
138106
with:
139-
python-version: ${{ matrix.python-version }}
107+
python-version: 3.8
108+
cache: pip
140109
- name: Create and start a virtual environment
141110
shell: bash
142111
run: |
@@ -171,24 +140,44 @@ jobs:
171140
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%
172141
.\build\Release\test_sanity.exe -d data -p tests\cpp\precommit\public_scope.json && .\build\Release\test_model_config -d data
173142
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

Comments
 (0)