onnxruntime/tools/ci_build/github/azure-pipelines/templates/py-package-smoking-test.yml
Changming Sun afd3e81c94
Remove PostBuildCleanup (#23233)
Remove PostBuildCleanup tasks since it is deprecated. It is to address a
warning in our pipelines:

"Task 'Post Build Cleanup' version 3 (PostBuildCleanup@3) is dependent
on a Node version (6) that is end-of-life. Contact the extension owner
for an updated version of the task. Task maintainers should review Node
upgrade guidance: https://aka.ms/node-runner-guidance"

Now the cleanup is controlled in another place:

https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/workspace?view=azure-pipelines


The code change was generated by the following Linux command:
```bash
find . -name \*.yml -exec sed -i '/PostBuildCleanup/,+2d' {} \;
```
2024-12-31 13:12:33 -08:00

59 lines
1.4 KiB
YAML

parameters:
- name: job_name
type: string
- name: itemPattern
type: string
default: '**'
- name: machine_pool
type: object
- name: python_arch
type: string
default: 'x64'
jobs:
- job: ${{ parameters.job_name }}
timeoutInMinutes: 30
workspace:
clean: all
pool:
${{ parameters.machine_pool }}
strategy:
matrix:
Python310:
PythonVersion: '3.10'
Python311:
PythonVersion: '3.11'
Python312:
PythonVersion: '3.12'
Python313:
PythonVersion: '3.13'
steps:
- checkout: none
- task: UsePythonVersion@0
displayName: 'Use Python'
inputs:
versionSpec: $(PythonVersion)
architecture: ${{ parameters.python_arch }}
- download: build # pipeline resource identifier.
artifact: 'onnxruntime'
- task: Bash@3
inputs:
targetType: 'inline'
script: |
set -ex
files=(*.whl)
FILE_NAME="${files[0]}"
FILE_NAME=$(basename $FILE_NAME)
PYTHON_PACKAGE_NAME=$(echo "$FILE_NAME" | cut -f 1 -d '-')
python3 -m pip install --find-links "$(Pipeline.Workspace)/build/onnxruntime" $PYTHON_PACKAGE_NAME
python3 -m pip show $PYTHON_PACKAGE_NAME
python3 -c "import onnxruntime as ort; print(ort.__version__)"
workingDirectory: $(Pipeline.Workspace)/build/onnxruntime
displayName: Test Package Installation