mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
ci: Only run lint jobs on relevant files (#158773)
Conditionally run lint jobs on relevant files, this is mainly targetd at clangtidy since it takes a long time but also includes mypy since that's an additional 4 minutes of runtime that we can save. Signed-off-by: Eli Uriegas <eliuriegas@meta.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/158773 Approved by: https://github.com/malfet
This commit is contained in:
committed by
PyTorch MergeBot
parent
b66f429827
commit
851e953f68
22
.github/workflows/lint.yml
vendored
22
.github/workflows/lint.yml
vendored
@ -35,6 +35,21 @@ jobs:
|
||||
lintrunner-clang:
|
||||
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
|
||||
needs: [get-label-type, get-changed-files]
|
||||
# Only run if there are changed files relevant to clangtidy / clangformat
|
||||
if: |
|
||||
github.repository_owner == 'pytorch' && (
|
||||
needs.get-changed-files.outputs.changed-files == '*' ||
|
||||
contains(needs.get-changed-files.outputs.changed-files, '.h') ||
|
||||
contains(needs.get-changed-files.outputs.changed-files, '.cpp') ||
|
||||
contains(needs.get-changed-files.outputs.changed-files, '.cc') ||
|
||||
contains(needs.get-changed-files.outputs.changed-files, '.cxx') ||
|
||||
contains(needs.get-changed-files.outputs.changed-files, '.hpp') ||
|
||||
contains(needs.get-changed-files.outputs.changed-files, '.hxx') ||
|
||||
contains(needs.get-changed-files.outputs.changed-files, '.cu') ||
|
||||
contains(needs.get-changed-files.outputs.changed-files, '.cuh') ||
|
||||
contains(needs.get-changed-files.outputs.changed-files, '.mm') ||
|
||||
contains(needs.get-changed-files.outputs.changed-files, '.metal')
|
||||
)
|
||||
with:
|
||||
timeout: 120
|
||||
runner: "${{ needs.get-label-type.outputs.label-type }}linux.2xlarge"
|
||||
@ -59,6 +74,13 @@ jobs:
|
||||
lintrunner-mypy:
|
||||
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
|
||||
needs: [get-label-type, get-changed-files]
|
||||
# Only run if there are changed files relevant to mypy
|
||||
if: |
|
||||
github.repository_owner == 'pytorch' && (
|
||||
needs.get-changed-files.outputs.changed-files == '*' ||
|
||||
contains(needs.get-changed-files.outputs.changed-files, '.py') ||
|
||||
contains(needs.get-changed-files.outputs.changed-files, '.pyi')
|
||||
)
|
||||
with:
|
||||
timeout: 120
|
||||
runner: "${{ needs.get-label-type.outputs.label-type }}linux.2xlarge"
|
||||
|
Reference in New Issue
Block a user