onnxruntime/tools/ci_build/github/azure-pipelines/templates/component-governance-component-detection-steps.yml
Jian Chen 456ab09d17
Component Governance fix round 5 (#20905)
…over the case where there is only single repo checked out

### Description
adding $(Build.SourcesDirectory)/cmake/external/onnx/third_party to
cover the case where there is only single repo checked out



### Motivation and Context
Fix CG issue
https://aiinfra.visualstudio.com/Lotus/_componentGovernance/97926/alert/8862110?typeId=16576846
2024-06-03 14:22:22 -07:00

36 lines
No EOL
2.3 KiB
YAML

# component detection for component governance checks
parameters:
- name: condition
type: string
default: 'succeeded' # could be 'ci_only', 'always', 'succeeded'
steps:
- ${{ if eq(variables['System.TeamProject'], 'Lotus') }}:
- powershell: |
Remove-Item $(Build.BinariesDirectory)/* -Recurse -Force
displayName: 'Clean up build directory'
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection'
continueOnError: true
condition:
or(or(and(eq('${{parameters.condition}}', 'ci_only'), and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'Scheduled'))),
and(eq('${{parameters.condition}}', 'always'), always())),
and(eq('${{parameters.condition}}', 'succeeded'), succeeded()))
inputs:
# ignore unit tests in emscripten. emscripten unit tests are not used in onnxruntime build
# ignore onnx third_party directory. onnx third_party directory is not responsible for onnxruntime build
# because sometime there are multiple repo is checked out in the same pipeline, we also need to add the repo name, such as onnxruntime/ to the ignoreDirectories
# ignore onnxruntime-extensions directory. onnxruntime-extensions directory is not responsible for onnxruntime build
# ignore react_native e2e node_modules directory. react_native e2e node_modules directory is generated by react_native e2e tests
# ignore github directory. github directory is used for github actions, not for onnxruntime package
# ignore onnxruntime-inference-examples directory. onnxruntime-inference-examples directory is used for inference examples, not for onnxruntime package
# ignore BinariesDirectory. BinariesDirectory is used for build output, not for onnxruntime package
ignoreDirectories:
'$(Build.Repository.LocalPath)/cmake/external/emsdk/upstream/emscripten/tests,
$(Build.Repository.LocalPath)/cmake/external/onnx/third_party,
$(Build.SourcesDirectory)/cmake/external/onnx/third_party,
$(Build.Repository.LocalPath)/cmake/external/onnxruntime-extensions,
$(Build.Repository.LocalPath)/js/react_native/e2e/node_modules,
$(Build.SourcesDirectory)/onnxruntime-inference-examples,
$(Build.BinariesDirectory)'