onnxruntime/tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml
kailums 3174e3da57
update pipline python version from 3.8 to 3.12 (#22517)
### Description
As the python3.8 is going to reach EOL. 

https://discuss.python.org/t/python-3-13-0-final-has-been-released/
https://discuss.python.org/t/python-3-8-is-now-officially-eol/66983

we update our ci pipeline python version which still using 3.8 to 3.12
2024-10-21 07:50:31 -07:00

125 lines
4.6 KiB
YAML

parameters:
AgentPool : 'Win-CPU'
NugetPackageName : ''
ArtifactSuffix: ''
StageSuffix: 'CPU'
# More Suffix is used to differentiate testing for GPU and GPU-Windows/GPU-Linux packages
MoreSuffix: ''
# For inference packages, the test data artifact name is drop-extra and no suffix is required.
# For training packages, to differentiate the artifact name we add '-training' suffix. This needs to be passed from
# the parent pipeline.
TestDataArtifactSuffix: ''
Skipx86Tests: 'false'
CudaVersion: ''
SpecificArtifact: false
BuildId: ''
stages:
- stage: NuGet_Test_Win_${{ parameters.StageSuffix }}${{ parameters.MoreSuffix }}
dependsOn:
- NuGet_Packaging_${{ parameters.StageSuffix }}
condition: succeeded()
jobs:
- job: NuGet_Test_Win_${{ parameters.StageSuffix }}${{ parameters.MoreSuffix }}
workspace:
clean: all
pool: ${{ parameters.AgentPool }}
variables:
- name: OnnxRuntimeBuildDirectory
value: '$(Build.BinariesDirectory)'
- name: SKIPNONPACKAGETESTS
value: 'ON'
- name: runCodesignValidationInjection
value: false
- name: CUDA_MODULE_LOADINGL
value: 'LAZY'
- name: GRADLE_OPTS
value: '-Dorg.gradle.daemon=false'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.12'
addToPath: true
architecture: x64
- task: NuGetToolInstaller@0
displayName: Use Nuget 6.10.x
inputs:
versionSpec: 6.10.x
- ${{ if ne( parameters.CudaVersion, '') }}:
- template: ../../templates/jobs/download_win_gpu_library.yml
parameters:
DownloadCUDA: true
DownloadTRT: true
CudaVersion: ${{ parameters.CudaVersion }}
- task: BatchScript@1
displayName: 'Setup Visual Studio env vars'
inputs:
filename: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat'
arguments: 'amd64'
modifyEnvironment: true
- template: ../../templates/flex-downloadPipelineArtifact.yml
parameters:
StepName: 'Download Pipeline Artifact'
ArtifactName: drop-signed-nuget-${{ parameters.ArtifactSuffix }}
TargetPath: '$(Build.BinariesDirectory)\nuget-artifact'
SpecificArtifact: ${{ parameters.SpecificArtifact }}
BuildId: ${{ parameters.BuildId }}
- template: get-nuget-package-version-as-variable.yml
parameters:
packageFolder: '$(Build.BinariesDirectory)\nuget-artifact'
- script: |
mklink /D /J models C:\local\models
workingDirectory: '$(Build.BinariesDirectory)'
displayName: 'Create models link'
# TODO: Add .Net Core AnyCPU test task
- script: |
@echo "Running Runtest.bat"
test\Microsoft.ML.OnnxRuntime.EndToEndTests\runtest.bat $(Build.BinariesDirectory)\nuget-artifact net8.0 x64 $(NuGetPackageVersionNumber)
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Run End to End Test (C#) .Net Core x64'
env:
PACKAGENAME: ${{ parameters.NugetPackageName }}
- ${{ if ne(parameters['Skipx86Tests'], 'true') }}:
- script: |
@echo "Running Runtest.bat"
test\Microsoft.ML.OnnxRuntime.EndToEndTests\runtest.bat $(Build.BinariesDirectory)\nuget-artifact net8.0 x86 $(NuGetPackageVersionNumber)
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Run End to End Test (C#) .Net Core x86'
env:
PACKAGENAME: ${{ parameters.NugetPackageName }}
# TODO: Add .Net Framework AnyCPU test task
- script: |
@echo "Running Runtest.bat"
test\Microsoft.ML.OnnxRuntime.EndToEndTests\runtest.bat $(Build.BinariesDirectory)\nuget-artifact net462 x64 $(NuGetPackageVersionNumber)
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Run End to End Test (C#) .NetFramework x64'
env:
PACKAGENAME: ${{ parameters.NugetPackageName }}
- ${{ if ne(parameters['Skipx86Tests'], 'true') }}:
- script: |
@echo "Running Runtest.bat"
test\Microsoft.ML.OnnxRuntime.EndToEndTests\runtest.bat $(Build.BinariesDirectory)\nuget-artifact net462 x86 $(NuGetPackageVersionNumber)
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Run End to End Test (C#) .NetFramework x86'
enabled: false
env:
PACKAGENAME: ${{ parameters.NugetPackageName }}
- template: ../../templates/component-governance-component-detection-steps.yml
parameters :
condition : 'always'
- template: ../../templates/clean-agent-build-directory-step.yml