68
68
description : ' Timeout for the job (in minutes)'
69
69
default : 60
70
70
type : number
71
+ architecture :
72
+ description : ' CPU architecture to build for'
73
+ default : " x64"
74
+ type : string
71
75
72
76
permissions :
73
77
id-token : write
@@ -107,45 +111,112 @@ jobs:
107
111
activate-with-label : false
108
112
instructions : " SSH with rdesktop using ssh -L 3389:localhost:3389 %%username%%@%%hostname%%"
109
113
- name : Add Conda scripts to GitHub path
114
+ if : inputs.architecture == 'x64'
110
115
run : |
111
116
echo "C:/Jenkins/Miniconda3/Scripts" >> $GITHUB_PATH
117
+ - name : Setup Git for Windows' minimal SDK
118
+ env :
119
+ DEPENDENCIES_DIR : c:\temp\dependencies\
120
+ if : inputs.architecture == 'arm64'
121
+ uses : git-for-windows/setup-git-for-windows-sdk@v1
122
+ with :
123
+ architecture : aarch64
124
+ path : " ${{env.DEPENDENCIES_DIR}}\\ git"
112
125
- uses : ./test-infra/.github/actions/set-channel
113
126
- name : Set PYTORCH_VERSION
114
- if : ${{ env.CHANNEL == 'test' }}
127
+ if : env.CHANNEL == 'test'
115
128
run : |
116
129
# When building RC, set the version to be the current candidate version,
117
130
# otherwise, leave it alone so nightly will pick up the latest
118
131
echo "PYTORCH_VERSION=${{ matrix.stable_version }}" >> "${GITHUB_ENV}"
119
132
- uses : ./test-infra/.github/actions/setup-binary-builds
133
+ if : inputs.architecture == 'x64'
120
134
with :
121
135
repository : ${{ inputs.repository }}
122
136
ref : ${{ inputs.ref }}
123
137
submodules : ${{ inputs.submodules }}
124
138
setup-miniconda : false
125
139
python-version : ${{ env.PYTHON_VERSION }}
126
140
cuda-version : ${{ env.CU_VERSION }}
127
- arch : ${{ env.ARCH }}
141
+ arch : ${{ inputs.architecture }}
128
142
- name : Install XPU support package
129
143
if : ${{ matrix.gpu_arch_type == 'xpu' }}
130
144
env :
131
145
XPU_VERSION : ' 2025.1'
132
146
run : |
133
147
cmd //c .\\test-infra\\.github\\scripts\\install_xpu.bat
148
+ - name : Checkout Target Repository (${{ env.REPOSITORY }})
149
+ if : inputs.architecture == 'arm64'
150
+ uses : actions/checkout@v4
151
+ with :
152
+ repository : ${{ env.REPOSITORY }}
153
+ ref : ${{ env.REF }}
154
+ path : ${{ env.REPOSITORY }}
155
+ submodules : recursive
156
+ - name : Bootstrap python
157
+ if : inputs.architecture == 'arm64'
158
+ uses : actions/setup-python@v5
159
+ with :
160
+ python-version : ${{ matrix.python_version }}
161
+ architecture : arm64
162
+ - name : Bootstrap Build Tools
163
+ if : inputs.architecture == 'arm64'
164
+ env :
165
+ DOWNLOADS_DIR : c:\temp\downloads\
166
+ DEPENDENCIES_DIR : c:\temp\dependencies\
167
+ SCRIPTS_DIR : test-infra\\.github\\scripts\\winarm64
168
+ run : |
169
+ "${{ env.SCRIPTS_DIR }}\bootstrap_buildtools.sh"
134
170
- name : Install torch dependency
171
+ if : inputs.architecture == 'x64'
135
172
run : |
136
173
source "${BUILD_ENV_FILE}"
137
174
# shellcheck disable=SC2086
138
175
${CONDA_RUN} ${PIP_INSTALL_TORCH}
139
176
- name : Run Pre-Script with Caching
140
- if : ${{ inputs.pre-script != '' }}
177
+ if : ${{ inputs.pre-script != '' && inputs.architecture == 'x64' }}
141
178
uses : ./test-infra/.github/actions/run-script-with-cache
142
179
with :
143
180
cache-path : ${{ inputs.cache-path }}
144
181
cache-key : ${{ inputs.cache-key }}
145
182
repository : ${{ inputs.repository }}
146
183
script : ${{ inputs.pre-script }}
147
184
is_windows : ' enabled'
185
+ - name : Run Pre-Script Arm64
186
+ if : ${{ inputs.pre-script != '' && inputs.architecture == 'arm64' }}
187
+ env :
188
+ DOWNLOADS_DIR : c:\temp\downloads\
189
+ DEPENDENCIES_DIR : c:\temp\dependencies\
190
+ SCRIPTS_DIR : test-infra\\.github\\scripts\\winarm64
191
+ SRC_DIR : ${{ inputs.repository }}
192
+ PRE_SCRIPT : ${{ inputs.pre-script }}
193
+ shell : cmd
194
+ run : |
195
+ set VS_PATH=%DEPENDENCIES_DIR%\VSBuildTools\VC\Auxiliary\Build\vcvarsall.bat
196
+ set GIT_BASH=%DEPENDENCIES_DIR%\git\usr\bin\bash.exe
197
+
198
+ cd %SRC_DIR%
199
+
200
+ call "%VS_PATH%" arm64
201
+ "%GIT_BASH%" -c "bash --noprofile --norc %PRE_SCRIPT%"
202
+ - name : Install certificates for Arm64 runner
203
+ if : ${{ inputs.architecture == 'arm64' }}
204
+ working-directory : ${{ inputs.repository }}
205
+ shell : cmd
206
+ run : |
207
+ call .\.venv\Scripts\activate.bat
208
+
209
+ pip install --upgrade certifi==2025.04.26
210
+ for /f "delims=" %%A in ('python -m certifi') do set CERT_PATH=%%A
211
+ echo Using cert bundle at: %CERT_PATH%
212
+
213
+ set SSL_CERT_FILE=%CERT_PATH%
214
+ set REQUESTS_CA_BUNDLE=%CERT_PATH%
215
+
216
+ echo SSL_CERT_FILE=%CERT_PATH% >> %GITHUB_ENV%
217
+ echo REQUESTS_CA_BUNDLE=%CERT_PATH% >> %GITHUB_ENV%
148
218
- name : Build clean
219
+ if : inputs.architecture == 'x64'
149
220
working-directory : ${{ inputs.repository }}
150
221
env :
151
222
ENV_SCRIPT : ${{ inputs.env-script }}
@@ -161,7 +232,8 @@ jobs:
161
232
${CONDA_RUN} ${ENV_SCRIPT} python setup.py clean
162
233
fi
163
234
fi
164
- - name : Build the wheel (bdist_wheel)
235
+ - name : Build the wheel (bdist_wheel) X64
236
+ if : inputs.architecture == 'x64'
165
237
working-directory : ${{ inputs.repository }}
166
238
env :
167
239
ENV_SCRIPT : ${{ inputs.env-script }}
@@ -182,17 +254,36 @@ jobs:
182
254
else
183
255
${CONDA_RUN} ${ENV_SCRIPT} python setup.py bdist_wheel ${BUILD_PARAMS}
184
256
fi
257
+ - name : Build the wheel (bdist_wheel) Arm64
258
+ if : inputs.architecture == 'arm64'
259
+ env :
260
+ SRC_DIR : ${{ inputs.repository }}
261
+ DEPENDENCIES_DIR : c:\temp\dependencies\
262
+ shell : cmd
263
+ run : |
264
+ set CONDA_PREFIX=%DEPENDENCIES_DIR%
265
+ set PATH=%PATH%;%DEPENDENCIES_DIR%\Library\bin
266
+ set DISTUTILS_USE_SDK=1
267
+ set VS_PATH=%DEPENDENCIES_DIR%\VSBuildTools\VC\Auxiliary\Build\vcvarsall.bat
268
+
269
+ call "%VS_PATH%" arm64
270
+ cd %SRC_DIR%
271
+ call .venv\Scripts\activate.bat
272
+
273
+ pip install --upgrade setuptools==72.1.0
274
+ python setup.py bdist_wheel
185
275
- name : Run post-script
186
276
working-directory : ${{ inputs.repository }}
187
277
env :
188
278
POST_SCRIPT : ${{ inputs.post-script }}
189
279
ENV_SCRIPT : ${{ inputs.env-script }}
190
- if : ${{ inputs.post-script != '' }}
280
+ if : ${{ inputs.post-script != '' && inputs.architecture == 'x64' }}
191
281
run : |
192
282
set -euxo pipefail
193
283
source "${BUILD_ENV_FILE}"
194
284
${CONDA_RUN} ${ENV_SCRIPT} ${POST_SCRIPT}
195
- - name : Smoke Test
285
+ - name : Smoke Test X64
286
+ if : inputs.architecture == 'x64'
196
287
env :
197
288
ENV_SCRIPT : ${{ inputs.env-script }}
198
289
PACKAGE_NAME : ${{ inputs.package-name }}
@@ -209,15 +300,44 @@ jobs:
209
300
echo "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT} found"
210
301
${CONDA_RUN} "${{ inputs.repository }}/${ENV_SCRIPT}" python "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT}"
211
302
fi
303
+ - name : Smoke Test ARM64
304
+ if : inputs.architecture == 'arm64'
305
+ env :
306
+ PACKAGE_NAME : ${{ inputs.package-name }}
307
+ SMOKE_TEST_SCRIPT : ${{ inputs.smoke-test-script }}
308
+ SRC_DIR : ${{ inputs.repository }}
309
+ run : |
310
+ cd $SRC_DIR
311
+ source .venv/Scripts/activate
312
+ whl=$(find dist -name "${{env.PACKAGE_NAME}}-*.whl" | head -n 1)
313
+ pip install $whl
314
+
315
+ if [[ ! -f ${SMOKE_TEST_SCRIPT} ]]; then
316
+ echo "${SMOKE_TEST_SCRIPT} not found"
317
+ python -c "import ${PACKAGE_NAME}; print('package version is ', ${PACKAGE_NAME}.__version__)"
318
+ else
319
+ echo "${SMOKE_TEST_SCRIPT} found"
320
+ python "$SMOKE_TEST_SCRIPT"
321
+ fi
212
322
# NB: Only upload to GitHub after passing smoke tests
323
+ - name : Get Artifact name
324
+ if : inputs.architecture == 'arm64'
325
+ env :
326
+ REPOSITORY : ${{ inputs.repository }}
327
+ REF : ${{ inputs.ref }}
328
+ PYTHON_VERSION : ${{ matrix.python_version }}
329
+ CU_VERSION : ${{ env.CU_VERSION }}
330
+ ARCH : ${{ inputs.architecture }}
331
+ run : |
332
+ echo "ARTIFACT_NAME=${REPOSITORY//\//_}_${REF//\//_}_${PYTHON_VERSION}_${CU_VERSION}_${ARCH}" >> "${GITHUB_ENV}"
213
333
- name : Upload wheel to GitHub
214
334
continue-on-error : true
215
335
uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
216
336
with :
217
337
name : ${{ env.ARTIFACT_NAME }}
218
338
path : ${{ inputs.repository }}/dist/
219
339
- uses : ./test-infra/.github/actions/teardown-windows
220
- if : always()
340
+ if : inputs.architecture == 'x64'
221
341
name : Teardown Windows
222
342
223
343
upload :
@@ -231,7 +351,8 @@ jobs:
231
351
test-infra-ref : ${{ inputs.test-infra-ref }}
232
352
build-matrix : ${{ inputs.build-matrix }}
233
353
trigger-event : ${{ inputs.trigger-event }}
354
+ architecture : ${{ inputs.architecture }}
234
355
235
356
concurrency :
236
357
group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ inputs.repository }}-${{ github.event_name == 'workflow_dispatch' }}
237
- cancel-in-progress : true
358
+ cancel-in-progress : true
0 commit comments