Repository navigation
124 lines (108 loc) · 3.89 KB
/
Copy pathwindows_arm64_python.yml
File metadata and controls
124 lines (108 loc) · 3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Windows ARM64 Build And Python Test
on:
push:
branches:
- main
- rel-*
pull_request:
branches:
- main
- rel-*
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
cancel-in-progress: true
jobs:
build_windows_arm64_python_wheel:
name: Build Windows ARM64 Python 3.12 wheel
runs-on: [ort-github-win-16-arm64-scus-ss]
timeout-minutes: 180
strategy:
fail-fast: false
env:
ALLOW_RELEASED_ONNX_OPSET_ONLY: "0"
OnnxRuntimeBuildDirectory: ${{ github.workspace }}\build
OrtPackageId: Microsoft.ML.OnnxRuntime
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
submodules: recursive
- name: Setup Python 3.12
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: 3.12
architecture: arm64
- name: Locate vcvarsall and Setup Env
uses: ./.github/actions/locate-vcvarsall-and-setup-env
with:
architecture: arm64
- name: Verify native ARM64 environment
shell: pwsh
run: |
$osArchitecture = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
if ($osArchitecture -ne [System.Runtime.InteropServices.Architecture]::Arm64) {
throw "Expected an ARM64 runner, but detected $osArchitecture."
}
python -c "import platform; assert platform.machine().lower() in ('arm64', 'aarch64'), platform.machine()"
- name: Install Python modules
shell: pwsh
run: python -m pip install -r tools\ci_build\github\windows\python\requirements.txt
- name: Build
shell: pwsh
run: |
python tools\ci_build\build.py `
--config RelWithDebInfo `
--compile_no_warning_as_error `
--build_dir "${{ github.workspace }}\build" `
--skip_submodule_sync `
--update `
--build `
--parallel `
--enable_lto `
--enable_pybind `
--enable_onnx_tests `
--use_vcpkg `
--use_vcpkg_ms_internal_asset_cache `
--use_binskim_compliant_compile_flags `
--cmake_generator "Visual Studio 17 2022" `
--use_azure
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
- name: Build wheel
working-directory: ${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo
shell: pwsh
run: |
python "${{ github.workspace }}\setup.py" bdist_wheel --use_azure
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
- name: Install wheel
working-directory: ${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo
shell: pwsh
run: |
python -m pip uninstall -y onnxruntime onnxruntime-gpu -qq
$wheel = Get-ChildItem -Path dist\*.whl -File
if ($wheel.Count -ne 1) {
throw "Expected exactly one wheel, but found $($wheel.Count)."
}
python -m pip install --disable-pip-version-check --upgrade $wheel.FullName tabulate
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
- name: Run Python tests
working-directory: ${{ github.workspace }}\build\RelWithDebInfo\RelWithDebInfo
shell: pwsh
run: |
$env:PATH = "${{ github.workspace }}\build\RelWithDebInfo\_deps\vcpkg-src\installed\arm64-windows\bin;$env:PATH"
python onnxruntime_test_python_azure.py
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
python onnx_backend_test_series.py
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}