forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (118 loc) · 4.95 KB
/
job_samples_tests.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Samples
on:
workflow_call:
inputs:
runner:
description: 'Machine on which the tests would run'
type: string
required: true
container:
description: 'JSON to be converted to the value of the "container" configuration for the job'
type: string
required: false
default: '{"image": null}'
affected-components:
description: 'Components that are affected by changes in the commit defined by the Smart CI Action'
type: string
required: true
permissions: read-all
jobs:
Samples:
timeout-minutes: 30
runs-on: ${{ inputs.runner }}
container: ${{ fromJSON(inputs.container) }}
defaults:
run:
shell: bash
env:
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input
INSTALL_DIR: ${{ github.workspace }}/install
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
INSTALL_WHEELS_DIR: ${{ github.workspace }}/install/wheels
BUILD_DIR: ${{ github.workspace }}/build
steps:
- name: Download OpenVINO artifacts (tarballs)
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: openvino_[package|tests]*
path: ${{ env.INSTALL_DIR }}
merge-multiple: true
- name: Download OpenVINO artifacts (wheels)
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: openvino_[wheels]*
path: ${{ env.INSTALL_WHEELS_DIR }}
merge-multiple: true
# Needed as ${{ github.workspace }} is not working correctly when using Docker
- name: Setup Variables
run: |
echo "INSTALL_DIR=$GITHUB_WORKSPACE/install" >> "$GITHUB_ENV"
echo "INSTALL_TEST_DIR=$GITHUB_WORKSPACE/install/tests" >> "$GITHUB_ENV"
echo "BUILD_DIR=$GITHUB_WORKSPACE/build" >> "$GITHUB_ENV"
echo "INSTALL_WHEELS_DIR=$GITHUB_WORKSPACE/install/wheels" >> "$GITHUB_ENV"
- name: Install OpenVINO dependencies (mac)
if: runner.os == 'macOS'
run: brew install coreutils pigz
- name: Extract OpenVINO packages and tests
run: |
pigz -dc openvino_package.tar.gz | tar -xf - -C ${INSTALL_DIR}
pigz -dc openvino_tests.tar.gz | tar -xf - -C ${INSTALL_DIR}
working-directory: ${{ env.INSTALL_DIR }}
- name: Fetch setup_python and install wheels actions
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
timeout-minutes: 15
with:
sparse-checkout: |
.github/actions/setup_python/action.yml
.github/actions/install_ov_wheels/action.yml
sparse-checkout-cone-mode: false
path: 'openvino'
- name: Setup Python 3.11
# Python is already installed on Ubuntu within Dockerfile
if: runner.os != 'Linux'
uses: ./openvino/.github/actions/setup_python
with:
version: '3.11'
should-setup-pip-paths: 'false'
- name: Configure Developer Command Prompt for Microsoft Visual C++ (2022)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
toolset: 14.40
- name: Build cpp samples
run: $INSTALL_DIR/samples/cpp/build_samples.sh -i $INSTALL_DIR -b $BUILD_DIR/cpp_samples
env:
CMAKE_COMPILE_WARNING_AS_ERROR: 'ON'
- name: Build cpp samples - Clang
if: runner.os == 'Linux'
run: |
apt-get update && apt-get install -y clang
$INSTALL_DIR/samples/cpp/build_samples.sh -i $INSTALL_DIR -b $BUILD_DIR/cpp_samples_clang
env:
CMAKE_COMPILE_WARNING_AS_ERROR: 'ON'
CC: clang
CXX: clang++
- name: Build c samples
run: $INSTALL_DIR/samples/c/build_samples.sh -i $INSTALL_DIR -b $BUILD_DIR/c_samples
env:
CMAKE_COMPILE_WARNING_AS_ERROR: 'ON'
#
# Tests
#
- name: Install OpenVINO Python wheels
uses: ./openvino/.github/actions/install_ov_wheels
with:
wheels-dir-path: ${{ env.INSTALL_WHEELS_DIR }}
wheels-to-install: 'openvino'
- name: Samples tests
if: fromJSON(inputs.affected-components).samples.test
run: |
export WORKSPACE=$INSTALL_DIR
export IE_APP_PATH=$INSTALL_DIR/samples_bin
export IE_APP_PYTHON_PATH=$INSTALL_DIR/samples/python
export SHARE=$INSTALL_TEST_DIR/smoke_tests/samples_smoke_tests_data
# Install Python benchmark_app by installing openvino-*.whl
python3 -m pip install --ignore-installed PyYAML -r $INSTALL_TEST_DIR/smoke_tests/requirements.txt
export LD_LIBRARY_PATH=${IE_APP_PATH}:$LD_LIBRARY_PATH
source ${INSTALL_DIR}/setupvars.sh
PYTHONCOERCECLOCALE=warn python3 -bb -W error -X dev -m pytest $INSTALL_TEST_DIR/smoke_tests