Skip to content

Commit 7da76ab

Browse files
authored
Add .github/workflows/build_demos.yml (#3652)
1 parent 5cee7ee commit 7da76ab

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/build_demos.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Demos
2+
3+
on:
4+
pull_request:
5+
branches: '**'
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-20.04
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
submodules: recursive
19+
- name: Set up Python 3.8
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: "3.8"
23+
- name: python -m pip install --upgrade pip && python -m pip install numpy
24+
run: |
25+
python -m pip install --upgrade pip
26+
python -m pip install numpy
27+
- name: Download OpenVINO
28+
run: |
29+
wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2022.3/linux/l_openvino_toolkit_ubuntu20_2022.3.0.9052.9752fafe8eb_x86_64.tgz
30+
tar xf l_openvino_toolkit_ubuntu20_2022.3.0.9052.9752fafe8eb_x86_64.tgz
31+
sudo l_openvino_toolkit_ubuntu20_2022.3.0.9052.9752fafe8eb_x86_64/install_dependencies/install_openvino_dependencies.sh
32+
- name: Cache OpenCV
33+
id: opencv-cache
34+
uses: actions/cache@v3
35+
with:
36+
path: ${{ github.workspace }}/opencv
37+
key: ${{ runner.os }}-opencv-cache
38+
- if: ${{ steps.opencv-cache.outputs.cache-hit != 'true' }}
39+
name: Checlout OpenCV
40+
uses: actions/checkout@v3
41+
with:
42+
repository: opencv/opencv
43+
path: opencv
44+
- if: ${{ steps.opencv-cache.outputs.cache-hit != 'true' }}
45+
name: Compile OpenCV
46+
run: |
47+
mkdir opencv/build
48+
cd opencv/build
49+
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_INF_ENGINE=ON -DOpenVINO_DIR=$GITHUB_WORKSPACE/l_openvino_toolkit_ubuntu20_2022.3.0.9052.9752fafe8eb_x86_64/runtime/cmake/ ..
50+
cmake --build . -j $((`nproc`*2+2))
51+
- name: build_demos.sh
52+
run: |
53+
source l_openvino_toolkit_ubuntu20_2022.3.0.9052.9752fafe8eb_x86_64/setupvars.sh
54+
OpenCV_DIR=$GITHUB_WORKSPACE/opencv/build ./demos/build_demos.sh -DENABLE_PYTHON=y

0 commit comments

Comments
 (0)