demos: test G-API on GitHub Actions #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: github-actions | |
on: pull_request | |
jobs: | |
cpp_gapi-demos: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
cache: pip | |
- name: python -m pip install --upgrade pip && python -m pip install numpy | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --extra-index-url https://download.pytorch.org/whl/cpu openvino==2023.1.0.dev20230728 openvino-dev[]==2023.1.0.dev20230728 tools/model_tools | |
# Reinstall OMZ tools that could come from openvino-dev because pip doesn't promise the order of installation | |
python -m pip install --no-cache-dir --no-deps tools/model_tools | |
# Make sure OpenVINO is used from C++ package, not from PyPi | |
python -m pip uninstall -y openvino | |
- name: Download OpenVINO | |
run: | | |
wget https://storage.openvinotoolkit.org/repositories/openvino/packages/2022.3/linux/l_openvino_toolkit_ubuntu20_2022.3.0.9052.9752fafe8eb_x86_64.tgz | |
tar xf l_openvino_toolkit_ubuntu20_2022.3.0.9052.9752fafe8eb_x86_64.tgz | |
sudo l_openvino_toolkit_ubuntu20_2022.3.0.9052.9752fafe8eb_x86_64/install_dependencies/install_openvino_dependencies.sh | |
- uses: hendrikmuhs/ccache-action@v1.2 | |
with: | |
max-size: "2000M" | |
# key: ccache | |
# restore-keys: ccache | |
- uses: actions/checkout@v3 | |
with: | |
repository: opencv/opencv | |
path: opencv | |
- name: Compile OpenCV | |
run: | | |
mkdir opencv/build | |
cd opencv/build | |
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_INF_ENGINE=y -DOpenVINO_DIR=$GITHUB_WORKSPACE/l_openvino_toolkit_ubuntu20_2022.3.0.9052.9752fafe8eb_x86_64/runtime/cmake/ -DCMAKE_CXX_LINKER_LAUNCHER=ccache .. | |
cmake --build . -j $((${{ steps.cpu-cores.outputs.count }}*2+2)) | |
- name: build_demos.sh | |
run: | | |
source l_openvino_toolkit_ubuntu20_2022.3.0.9052.9752fafe8eb_x86_64/setupvars.sh | |
OpenCV_DIR=$GITHUB_WORKSPACE/opencv/build ./demos/build_demos.sh --build_dir=build | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ github.workspace }}/downloader-cache-dir | |
key: downloader-cache-dir | |
- name: run_tests.py | |
run: | | |
source l_openvino_toolkit_ubuntu20_2022.3.0.9052.9752fafe8eb_x86_64/setupvars.sh | |
python demos/tests/run_tests.py --demo-build-dir build/intel64/Release/ --test-data-dir ~/Downloads/test-data/ --device CPU --downloader-cache-dir ${{ github.workspace }}/downloader-cache-dir --demos cpp_gapi |