@@ -102,6 +102,9 @@ stages:
102102
103103- stage : iOS_Full_xcframework
104104 dependsOn : []
105+ variables :
106+ xcodeVersion : " 26.3"
107+ iosSimulatorRuntimeVersion : " 26.2"
105108 jobs :
106109 - job : iOS_Full_xcframework
107110 workspace :
@@ -118,7 +121,7 @@ stages:
118121
119122 - template : use-xcode-version.yml
120123 parameters :
121- xcodeVersion : 16.4
124+ xcodeVersion : ${{ variables.xcodeVersion }}
122125
123126 - template : setup-build-tools.yml
124127 parameters :
@@ -129,25 +132,82 @@ stages:
129132 python3 tools/ci_build/github/apple/build_apple_framework.py \
130133 --build_dir "$(Build.BinariesDirectory)/ios_framework" \
131134 tools/ci_build/github/apple/default_full_ios_framework_build_settings.json
132- mkdir $(Build.BinariesDirectory)/artifacts
135+ displayName: "Build Apple xcframework"
136+
137+ - script : |
138+ set -e -x
139+
140+ # Stage onnxruntime.xcframework as artifact.
141+ mkdir -p $(Build.BinariesDirectory)/artifacts/xcframework
142+
133143 pushd $(Build.BinariesDirectory)/ios_framework/framework_out
134- zip -vry $(Build.BinariesDirectory)/artifacts/onnxruntime_ios_xcframework.$(OnnxRuntimeVersion).zip \
144+ zip -vry $(Build.BinariesDirectory)/artifacts/xcframework/ onnxruntime_ios_xcframework.$(OnnxRuntimeVersion).zip \
135145 onnxruntime.xcframework
136146 popd
137- displayName: "Build Apple xcframework"
147+
148+ # Stage framework_out and xcframework_info.json as test artifact.
149+ # Note: framework_out has another copy of onnxruntime.xcframework. This duplication is simpler than
150+ # reconstructing the test files from two separate pipeline artifacts.
151+ mkdir -p $(Build.BinariesDirectory)/artifacts/test
152+
153+ pushd $(Build.BinariesDirectory)/ios_framework
154+ zip -vry $(Build.BinariesDirectory)/artifacts/test/test_files.zip \
155+ framework_out xcframework_info.json
156+ popd
157+ displayName: "Stage artifacts"
158+
159+ - task : 1ES.PublishPipelineArtifact@1
160+ inputs :
161+ targetPath : ' $(Build.BinariesDirectory)/artifacts/xcframework'
162+ artifactName : ' onnxruntime-ios-full-xcframework'
163+
164+ - task : 1ES.PublishPipelineArtifact@1
165+ inputs :
166+ targetPath : ' $(Build.BinariesDirectory)/artifacts/test'
167+ artifactName : ' onnxruntime-ios-full-xcframework-test'
168+
169+ # Run the framework test on a Microsoft-hosted macOS image, which has the required iOS simulator runtime.
170+ # The build above stays on the faster ACES pool; only this lighter test job uses the hosted image.
171+ # It consumes the onnxruntime-ios-full-xcframework-test artifact published by the build job.
172+ - job : iOS_Full_xcframework_test
173+ dependsOn : iOS_Full_xcframework
174+ workspace :
175+ clean : all
176+ pool :
177+ name : " Azure Pipelines"
178+ image : " macOS-15"
179+ os : macOS
180+ timeoutInMinutes : 90
181+ templateContext :
182+ inputs :
183+ - input : pipelineArtifact
184+ artifactName : ' onnxruntime-ios-full-xcframework-test'
185+ targetPath : ' $(Build.BinariesDirectory)/artifacts/test'
186+ steps :
187+ - checkout : self
188+
189+ - template : use-xcode-version.yml
190+ parameters :
191+ xcodeVersion : ${{ variables.xcodeVersion }}
192+
193+ - template : setup-build-tools.yml
194+ parameters :
195+ host_cpu_arch : arm64
196+
197+ - script : |
198+ set -e -x
199+ unzip "$(Build.BinariesDirectory)/artifacts/test/test_files.zip" -d "$(Build.BinariesDirectory)"
200+ displayName: "Extract test files"
138201
139202 - script : |
140203 python3 tools/ci_build/github/apple/test_apple_packages.py \
141- --framework_info_file "$(Build.BinariesDirectory)/ios_framework/ xcframework_info.json" \
142- --c_framework_dir "$(Build.BinariesDirectory)/ios_framework/ framework_out" \
204+ --framework_info_file "$(Build.BinariesDirectory)/xcframework_info.json" \
205+ --c_framework_dir "$(Build.BinariesDirectory)/framework_out" \
143206 --skip_macos_test \
144207 --mac_catalyst_enabled
145208 displayName: "Test Apple framework"
146-
147- - task : 1ES.PublishPipelineArtifact@1
148- inputs :
149- targetPath : ' $(Build.BinariesDirectory)/artifacts'
150- artifactName : ' onnxruntime-ios-full-xcframework'
209+ env:
210+ ORT_GET_SIMULATOR_DEVICE_INFO_REQUESTED_RUNTIME_VERSION: ${{ variables.iosSimulatorRuntimeVersion }}
151211
152212 - template : win-ci.yml
153213 parameters :
0 commit comments