forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'openvinotoolkit:master' into master
- Loading branch information
Showing
1,944 changed files
with
71,216 additions
and
42,758 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: 'Setup Python and pip cache' | ||
description: 'Setups Python with the provided version and sets up the pip cache' | ||
inputs: | ||
version: | ||
description: 'Python version to install' | ||
required: true | ||
pip-cache-path: | ||
description: 'Path on share where the pip cache is stored' | ||
required: false | ||
should-setup-pip-paths: | ||
description: 'If the action should setup `PIP_CACHE_DIR` & `PIP_INSTALL_PATH` env variables' | ||
required: false | ||
default: 'false' | ||
self-hosted-runner: | ||
description: 'If the runner is self-hosted' | ||
required: false | ||
default: 'true' | ||
show-cache-info: | ||
description: 'If the action should show the share space occupied by cache' | ||
required: false | ||
default: 'false' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
|
||
- if: ${{ runner.os == 'Linux' && inputs.self-hosted-runner == 'true' }} | ||
name: Install 'actions/setup-python@v4' dependencies | ||
shell: bash | ||
run: apt-get update && apt-get install -y ca-certificates | ||
|
||
- if: ${{ runner.os == 'Linux' && runner.arch == 'ARM64' }} | ||
name: Setup sudo | ||
shell: bash | ||
run: apt-get update && apt-get install -y sudo # Needed for the deadsnakes action | ||
|
||
- if: ${{ runner.os == 'Linux' && runner.arch == 'ARM64' }} | ||
name: Setup Python ${{ inputs.version }} | ||
uses: deadsnakes/[email protected] | ||
with: | ||
python-version: ${{ inputs.version }} | ||
|
||
- if: ${{ runner.os == 'macOS' || runner.os == 'Windows' || (runner.os == 'Linux' && runner.arch != 'ARM64') }} | ||
name: Setup Python ${{ inputs.version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ inputs.version }} | ||
env: | ||
PIP_CACHE_DIR: ${{ inputs.self-hosted-runner == 'true' && inputs.pip-cache-path || '' }} | ||
|
||
- if: ${{ inputs.should-setup-pip-paths == 'true' }} | ||
name: Setup pip variables (cache and install path) | ||
shell: bash | ||
run: | | ||
PIP_VER=$(python3 -c "import pip; print(pip.__version__)") | ||
echo "Using pip version: ${PIP_VER}" | ||
echo "PIP_CACHE_DIR=${{ inputs.pip-cache-path }}/${PIP_VER}" >> $GITHUB_ENV | ||
echo "PIP_INSTALL_PATH=$(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')" >> $GITHUB_ENV | ||
- if: ${{ inputs.show-cache-info == 'true' }} | ||
name: Get pip cache info | ||
shell: bash | ||
run: | | ||
echo "Cache size: " | ||
du -h -d2 ${{ env.PIP_CACHE_DIR }} | ||
echo "Cache info: " | ||
python3 -m pip cache info | ||
continue-on-error: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: "Smart CI action" | ||
description: "Returns product components affected by PR or commit" | ||
inputs: | ||
repository: | ||
description: "GitHub repository" | ||
required: true | ||
repo_token: | ||
description: "Token for access to GitHub repository" | ||
required: true | ||
pr: | ||
description: "GitHub PR number. If not set - commit is used" | ||
required: false | ||
commit_sha: | ||
description: "GitHub commit hash. Used if no PR number is set" | ||
required: false | ||
component_pattern: | ||
description: "Pattern to extract component name from PR label. If not set, any label is considered a component name" | ||
required: false | ||
labeler_check_name: | ||
description: "Name of the labeler check" | ||
required: false | ||
default: "triage" | ||
components_config: | ||
description: "Path to components configuration file" | ||
required: false | ||
default: ".github/components.yml" | ||
components_config_schema: | ||
description: "Path to the schema file for components configuration" | ||
required: false | ||
default: ".github/actions/smart-ci/components_schema.yml" | ||
labeler_config: | ||
description: "Path to labeler configuration file" | ||
required: false | ||
default: ".github/labeler.yml" | ||
|
||
outputs: | ||
all_components: | ||
description: "All components listed in configuration" | ||
value: ${{ steps.smart_ci.outputs.all_components }} | ||
affected_components: | ||
description: "Affected components to run validation for and their validation scope" | ||
value: ${{ steps.smart_ci.outputs.affected_components }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Wait for labeler to finish | ||
uses: lewagon/[email protected] | ||
if: ${{ github.event_name == 'pull_request' }} | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
check-name: ${{ inputs.labeler_check_name }} | ||
repo-token: ${{ inputs.repo_token }} | ||
wait-interval: 10 | ||
|
||
- name: checkout components file | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: .github/components.yml | ||
sparse-checkout-cone-mode: false | ||
|
||
- name: Install Python dependencies | ||
uses: py-actions/py-dependency-install@v4 | ||
with: | ||
path: "${{ github.action_path }}/requirements.txt" | ||
update-setuptools: "false" | ||
update-wheel: "false" | ||
|
||
- name: Test functionality | ||
run: | | ||
python ${{ github.action_path }}/smart_ci_test.py | ||
shell: bash | ||
|
||
- name: Smart CI | ||
id: smart_ci | ||
run: | | ||
python ${{ github.action_path }}/smart_ci.py \ | ||
$([[ -n "${{ inputs.pr }}" ]] && echo '--pr ${{ inputs.pr }}' || echo '-s ${{ inputs.commit_sha }}') \ | ||
-r ${{ inputs.repository }} \ | ||
-p "${{ inputs.component_pattern }}" \ | ||
-c "${{ inputs.components_config }}" \ | ||
-m "${{ inputs.components_config_schema }}" \ | ||
-l "${{ inputs.labeler_config }}" | ||
shell: bash | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.repo_token }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# YAML schema for Smart CI configuration file components.yml (see https://json-schema.org) | ||
|
||
definitions: | ||
component_name: | ||
type: string | ||
pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$" | ||
|
||
component_data: | ||
type: object # dict | ||
additionalProperties: false | ||
properties: | ||
cmake: | ||
type: array | ||
uniqueItems: true | ||
items: | ||
'$ref': '#/definitions/component_name' | ||
|
||
revalidate: | ||
type: array | ||
uniqueItems: true | ||
items: | ||
'$ref': '#/definitions/component_name' | ||
|
||
build: | ||
type: array | ||
uniqueItems: true | ||
items: | ||
'$ref': '#/definitions/component_name' | ||
|
||
propertyNames: # Validates component names | ||
'$ref': '#/definitions/component_name' | ||
patternProperties: | ||
".*": # Component (name validated via propertyNames) | ||
'$ref': '#/definitions/component_data' | ||
additionalProperties: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ghapi~=1.0.4 | ||
pyyaml~=6.0.1 | ||
jsonschema~=4.19.1 |
Oops, something went wrong.