Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/actions/smart-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ inputs:
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"
check_names_to_wait:
description: "Name of the checks to wait for"
required: false
default: "triage"
components_config:
Expand Down Expand Up @@ -65,21 +65,22 @@ runs:
using: "composite"
steps:
- name: checkout wait-for-check action
if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
repository: openvinotoolkit/openvino
sparse-checkout: .github/actions/wait-for-check-completion
sparse-checkout-cone-mode: false

- name: Wait for labeler to finish
- name: Wait for ${{ inputs.check_names_to_wait }} to finish
uses: ./.github/actions/wait-for-check-completion
if: ${{ github.event_name == 'pull_request' }}
with:
ref: ${{ github.event.pull_request.head.sha }}
check-names: "${{ inputs.labeler_check_name }}"
check-names: ${{ inputs.check_names_to_wait }}
repo-token: ${{ inputs.repo_token }}
wait-interval: 10
timeout: 300
wait-interval: 20
timeout: 600

- name: checkout components file
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
Expand Down
67 changes: 36 additions & 31 deletions .github/actions/wait-for-check-completion/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29928,6 +29928,16 @@ function wrappy (fn, cb) {
const core = __nccwpck_require__(7484);
const github = __nccwpck_require__(3228);

const CONCLUSION_STATES = {
SUCCESS: 'success',
FAILURE: 'failure',
MIXED: 'mixed',
ACTION_REQUIRED: 'action_required',
TIMED_OUT: 'timed_out',
CANCELLED: 'cancelled',
COMPLETED: 'completed'
};

/**
* Wait for multiple checks to complete
* @param {Object} octokit - GitHub API client
Expand All @@ -29950,7 +29960,7 @@ async function waitForChecks(octokit, owner, repo, ref, checkNames, waitInterval
const checkResults = {};
const pendingChecks = new Set(checkNames);

while ((Date.now() - startTime < timeoutMs) && (pendingChecks.size > 0)) {
while ((Date.now() - startTime < timeoutMs) && pendingChecks.size) {
try {
// Get all check runs for the specific commit
const { data: checkRuns } = await octokit.rest.checks.listForRef({
Expand All @@ -29963,10 +29973,10 @@ async function waitForChecks(octokit, owner, repo, ref, checkNames, waitInterval
core.info(`Found ${checkRuns.check_runs.length} total check runs`);

// Process each pending check
for (const checkName of Array.from(pendingChecks)) {
for (const checkName of pendingChecks) {
const matchingRuns = checkRuns.check_runs.filter(run => run.name === checkName);

if (matchingRuns.length === 0) {
if (!matchingRuns.length) {
core.info(`No check runs found for "${checkName}" yet, waiting...`);
continue;
}
Expand All @@ -29976,28 +29986,28 @@ async function waitForChecks(octokit, owner, repo, ref, checkNames, waitInterval
new Date(b.started_at) - new Date(a.started_at)
)[0];

core.info(`Check "${checkName}" status: ${latestCheckRun.status}, conclusion: ${latestCheckRun.conclusion || 'N/A'}`);

if (latestCheckRun.status === 'completed') {
core.info(`Check "${checkName}" completed with conclusion: ${latestCheckRun.conclusion}`);
core.info(`Check "${checkName}" with URL: "${latestCheckRun.html_url}" completed with conclusion: ${latestCheckRun.conclusion}`);
checkResults[checkName] = {
status: latestCheckRun.status,
conclusion: latestCheckRun.conclusion,
checkRun: latestCheckRun
};
pendingChecks.delete(checkName);
} else if (latestCheckRun.status === 'in_progress') {
core.info(`Check "${checkName}" is still in progress...`);
core.info(`Check "${checkName}" with URL: "${latestCheckRun.html_url}" is still in progress...`);
} else if (latestCheckRun.status === 'queued') {
core.info(`Check "${checkName}" is queued...`);
core.info(`Check "${checkName}" with URL: "${latestCheckRun.html_url}" is queued...`);
}
}

if (pendingChecks.size === 0) {

if (pendingChecks.size) {
core.info(`Still waiting for [${Array.from(pendingChecks).join(', ')}]. Waiting ${waitInterval} seconds before next check...`);
await new Promise(resolve => setTimeout(resolve, waitIntervalMs));
} else {
core.info('All checks completed, parsing conclusions...');
break;
}

} catch (error) {
core.warning(`Error fetching check runs: ${error.message}`);

Expand All @@ -30009,14 +30019,9 @@ async function waitForChecks(octokit, owner, repo, ref, checkNames, waitInterval
core.error(`API error: ${error.message}`);
}
}

if (pendingChecks.size > 0) {
core.info(`Still waiting for [${Array.from(pendingChecks).join(', ')}]. Waiting ${waitInterval} seconds before next check...`);
await new Promise(resolve => setTimeout(resolve, waitIntervalMs));
}
}

if (pendingChecks.size > 0) {
if (pendingChecks.size) {
const pendingChecksList = Array.from(pendingChecks).join(', ');
throw new Error(`Timeout: Checks [${pendingChecksList}] did not complete within ${timeout} seconds`);
}
Expand Down Expand Up @@ -30071,37 +30076,37 @@ async function run() {

// Determine overall conclusion
let overallConclusion;
if (allConclusions.every(c => c === 'success')) {
overallConclusion = 'success';
} else if (allConclusions.some(c => ['failure', 'cancelled', 'timed_out'].includes(c))) {
overallConclusion = 'failure';
} else if (allConclusions.some(c => c === 'action_required')) {
overallConclusion = 'action_required';
if (allConclusions.every(c => c === CONCLUSION_STATES.SUCCESS)) {
overallConclusion = CONCLUSION_STATES.SUCCESS;
} else if (allConclusions.some(c => [CONCLUSION_STATES.FAILURE, CONCLUSION_STATES.CANCELLED, CONCLUSION_STATES.TIMED_OUT].includes(c))) {
overallConclusion = CONCLUSION_STATES.FAILURE;
} else if (allConclusions.some(c => c === CONCLUSION_STATES.ACTION_REQUIRED)) {
overallConclusion = CONCLUSION_STATES.ACTION_REQUIRED;
} else {
overallConclusion = 'mixed';
overallConclusion = CONCLUSION_STATES.MIXED;
}

// Set outputs
core.setOutput('status', allStatuses.every(s => s === 'completed') ? 'completed' : 'mixed');
core.setOutput('status', allStatuses.every(s => s === CONCLUSION_STATES.COMPLETED) ? CONCLUSION_STATES.COMPLETED : CONCLUSION_STATES.MIXED);
core.setOutput('conclusion', overallConclusion);
core.setOutput('results', JSON.stringify(results));

// Log results
for (const [checkName, result] of Object.entries(results)) {
core.info(`${checkName}: ${result.status} (${result.conclusion})`);
core.info(`${checkName}: Status is "${result.status}", Conclusion is "${result.conclusion}"`);
}

// Exit with appropriate code based on overall conclusion
if (overallConclusion === 'success') {
if (overallConclusion === CONCLUSION_STATES.SUCCESS) {
core.info('All checks completed with successful conclusions');
} else if (overallConclusion === 'failure') {
} else if (overallConclusion === CONCLUSION_STATES.FAILURE) {
const failedChecks = Object.entries(results)
.filter(([_, result]) => ['failure', 'cancelled', 'timed_out'].includes(result.conclusion))
.filter(([_, result]) => [CONCLUSION_STATES.FAILURE, CONCLUSION_STATES.CANCELLED, CONCLUSION_STATES.TIMED_OUT].includes(result.conclusion))
.map(([name, _]) => name);
core.setFailed(`Some checks failed: [${failedChecks.join(', ')}]`);
} else if (overallConclusion === 'action_required') {
} else if (overallConclusion === CONCLUSION_STATES.ACTION_REQUIRED) {
const actionRequiredChecks = Object.entries(results)
.filter(([_, result]) => result.conclusion === 'action_required')
.filter(([_, result]) => result.conclusion === CONCLUSION_STATES.ACTION_REQUIRED)
.map(([name, _]) => name);
core.setFailed(`Some checks require action: [${actionRequiredChecks.join(', ')}]`);
} else {
Expand Down

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions .github/actions/wait-for-check-completion/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,18 @@ async function waitForChecks(octokit, owner, repo, ref, checkNames, waitInterval
new Date(b.started_at) - new Date(a.started_at)
)[0];

core.info(`Check "${checkName}" status: ${latestCheckRun.status}, conclusion: ${latestCheckRun.conclusion || 'N/A'}`);

if (latestCheckRun.status === 'completed') {
core.info(`Check "${checkName}" completed with conclusion: ${latestCheckRun.conclusion}`);
core.info(`Check "${checkName}" with URL: "${latestCheckRun.html_url}" completed with conclusion: ${latestCheckRun.conclusion}`);
checkResults[checkName] = {
status: latestCheckRun.status,
conclusion: latestCheckRun.conclusion,
checkRun: latestCheckRun
};
pendingChecks.delete(checkName);
} else if (latestCheckRun.status === 'in_progress') {
core.info(`Check "${checkName}" is still in progress...`);
core.info(`Check "${checkName}" with URL: "${latestCheckRun.html_url}" is still in progress...`);
} else if (latestCheckRun.status === 'queued') {
core.info(`Check "${checkName}" is queued...`);
core.info(`Check "${checkName}" with URL: "${latestCheckRun.html_url}" is queued...`);
}
}

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ permissions: read-all
jobs:
Smart_CI:
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
Expand All @@ -46,6 +47,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg,*/layer_tests_summary/*,*/conformance/*'
check_names_to_wait: "triage,clang-format,clang-format-aarch64,clang-format-riscv64,ShellCheck,NamingConventionCheck"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe makes sense to set is as a default value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine as it is, since it is an action and could be used in other repositories that most likely would not have such checks.


Docker:
needs: Smart_CI
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions: read-all
jobs:
Smart_CI:
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/clang_tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ env:
jobs:
Smart_CI:
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
Expand All @@ -44,6 +45,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg,*/layer_tests_summary/*,*/conformance/*'
check_names_to_wait: "triage,clang-format,clang-format-aarch64,clang-format-riscv64,ShellCheck,NamingConventionCheck"

- name: Show affected components
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ jobs:

NamingConventionCheck:
needs: Docker
runs-on: aks-linux-4-cores-16gb
runs-on: aks-linux-16-cores-32gb
container:
image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64_code_style }}
volumes:
Expand All @@ -210,4 +210,4 @@ jobs:
run: cmake -B build

- name: Naming convention check
run: cmake --build build --target ncc_all -j8
run: cmake --build build --target ncc_all -j$(nproc)
1 change: 1 addition & 0 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:

Smart_CI:
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/debian_10_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ permissions: read-all
jobs:
Smart_CI:
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
Expand All @@ -46,6 +47,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg,*/layer_tests_summary/*,*/conformance/*'
check_names_to_wait: "triage,clang-format,clang-format-aarch64,clang-format-riscv64,ShellCheck,NamingConventionCheck"

- name: Show affected components
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dev_cpu_linux_snippets_libxsmm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ env:
jobs:
Smart_CI:
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
Expand All @@ -49,6 +50,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg'
check_names_to_wait: "triage,clang-format,clang-format-aarch64,clang-format-riscv64,ShellCheck,NamingConventionCheck"

- name: Show affected components
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/fedora_29.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ permissions: read-all
jobs:
Smart_CI:
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
Expand All @@ -46,6 +47,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg,*/layer_tests_summary/*,*/conformance/*'
check_names_to_wait: "triage,clang-format,clang-format-aarch64,clang-format-riscv64,ShellCheck,NamingConventionCheck"

- name: Show affected components
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/linux_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ env:
jobs:
Smart_CI:
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
Expand All @@ -50,6 +51,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg'
check_names_to_wait: "triage,clang-format,clang-format-aarch64,clang-format-riscv64,ShellCheck,NamingConventionCheck"

- name: Show affected components
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/linux_conditional_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ env:
jobs:
Smart_CI:
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
Expand All @@ -51,6 +52,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg,*/layer_tests_summary/*,*/conformance/*'
check_names_to_wait: "triage,clang-format,clang-format-aarch64,clang-format-riscv64,ShellCheck,NamingConventionCheck"

- name: Show affected components
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/linux_riscv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ env:
jobs:
Smart_CI:
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
Expand All @@ -50,6 +51,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg,*/layer_tests_summary/*,*/conformance/*'
check_names_to_wait: "triage,clang-format,clang-format-aarch64,clang-format-riscv64,ShellCheck,NamingConventionCheck"

- name: Get target branch
id: set_target_branch
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/linux_riscv_xuantie_dev_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ env:
jobs:
Smart_CI:
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
Expand All @@ -68,6 +69,7 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg,*/layer_tests_summary/*,*/conformance/*'
check_names_to_wait: "triage,clang-format,clang-format-aarch64,clang-format-riscv64,ShellCheck,NamingConventionCheck"

- name: Get target branch
id: set_target_branch
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linux_sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ env:
jobs:
Smart_CI:
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:

Smart_CI:
runs-on: ubuntu-latest
timeout-minutes: 25
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
Expand Down
Loading
Loading