mirror of
https://github.com/NVIDIA/Model-Optimizer.git
synced 2026-10-02 03:14:52 +08:00
### What does this PR do? Type of change: CI/CD maintenance Last of the [Node 20](https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/) actions: `step-security/changed-files` v46.0.5 → v47.0.5, in `_pr_gate.yml`, `example_tests.yml` and `unit_tests.yml`. Deliberately separate from #2102. Every gate in the repo runs through this action, and the example lanes depend on its `files_yaml` per-group outputs plus `any_modified` semantics. v47 has no release notes describing output behavior, and the upstream v47 notes are dependency bumps only — so this is the one bump I could not clear from a changelog. On its own, any gating regression is unambiguous. What I did verify at `v47.0.5`: - `micromatch` is still `^4.0.5` — the matcher the lane patterns were validated against - `files`, `files_ignore`, `files_yaml`, `files_ignore_yaml` are all still inputs - `any_modified`, `any_changed`, `changed_keys` are all still documented outputs ### Testing Static checks above. The behavior that matters cannot be proven from this PR: it changes workflow files, which are in the `common` group, so **every lane runs regardless** of whether gating still works. I plan to confirm with a throwaway probe PR against this branch — a docs-only change must run nothing, and a single-example change must run exactly one lane — the same method that caught the two ignore bugs fixed in #2101. ### Before your PR is "*Ready for review*" - Is this change backward compatible?: ✅ - If you copied code from any other sources or added a new PIP dependency, did you follow guidance in `CONTRIBUTING.md`: N/A - Did you write any new necessary tests?: N/A — CI configuration - Did you update [Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?: N/A - Did you get Claude approval on this PR?: ❌ — not yet run <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated pull-request file-change checks to use the latest available file-detection action. * Applied the update consistently across example-test and unit-test workflows. * Improved consistency and reliability across automated pull-request validation checks without changing application behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
65 lines
2.1 KiB
YAML
65 lines
2.1 KiB
YAML
name: PR Gate
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
files:
|
|
description: "Newline-separated list of file patterns to watch for changes"
|
|
required: true
|
|
type: string
|
|
files_ignore:
|
|
description: "Newline-separated patterns to ignore; defaults to docs-only files no test runs"
|
|
required: false
|
|
type: string
|
|
default: |
|
|
**/*.ipynb
|
|
**/*.md
|
|
**/*.png
|
|
**/*.rst
|
|
outputs:
|
|
any_changed:
|
|
description: "Whether any relevant files changed"
|
|
value: ${{ jobs.check-file-changes.outputs.any_changed }}
|
|
|
|
jobs:
|
|
check-file-changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
any_changed: ${{ steps.changed-tests.outputs.any_modified || steps.non-pr.outputs.any_changed }}
|
|
steps:
|
|
# For non-PR triggers (schedule, workflow_dispatch), always run tests
|
|
- id: non-pr
|
|
if: "!startsWith(github.ref, 'refs/heads/pull-request/')"
|
|
run: echo "any_changed=true" >> $GITHUB_OUTPUT
|
|
- if: startsWith(github.ref, 'refs/heads/pull-request/')
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
- if: startsWith(github.ref, 'refs/heads/pull-request/')
|
|
id: base
|
|
uses: ./.github/actions/pr-merge-base
|
|
- if: startsWith(github.ref, 'refs/heads/pull-request/')
|
|
name: Check for changes in test-relevant directories
|
|
id: changed-tests
|
|
uses: step-security/changed-files@v47.0.5
|
|
with:
|
|
base_sha: ${{ steps.base.outputs.merge_base }}
|
|
sha: ${{ steps.base.outputs.head_sha }}
|
|
files: ${{ inputs.files }}
|
|
files_ignore: ${{ inputs.files_ignore }}
|
|
fail_on_initial_diff_error: true
|
|
wait-checks:
|
|
needs: [check-file-changes]
|
|
if: >-
|
|
startsWith(github.ref, 'refs/heads/pull-request/') &&
|
|
needs.check-file-changes.outputs.any_changed == 'true'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
checks: read
|
|
steps:
|
|
- uses: poseidon/wait-for-status-checks@v0.7.0
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
match_pattern: "^linux$" # Wait for Unit tests / linux
|
|
delay: 300s
|