Skip to content
209 changes: 203 additions & 6 deletions .pipelines/foundry-local-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ extends:
- job: flc_win_arm64
displayName: 'win-arm64'
pool:
name: onnxruntime-Win-CPU-2022
name: onnxruntime-native-arm64-16core
os: windows
templateContext:
outputs:
Expand All @@ -165,6 +165,8 @@ extends:
steps:
- checkout: neutron-server
clean: true
- checkout: test-data-shared
lfs: true
- template: .pipelines/templates/build-core-steps.yml@self
parameters:
flavor: win-arm64
Expand Down Expand Up @@ -203,8 +205,13 @@ extends:
artifactName: 'flc-osx-arm64'
targetPath: '$(Build.ArtifactStagingDirectory)/native'
steps:
# AcesShared macOS agents don't have git-lfs pre-installed
- script: brew install git-lfs && git lfs install
displayName: 'Install Git LFS'
- checkout: neutron-server
clean: true
- checkout: test-data-shared
lfs: true
Comment on lines +208 to +214
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In flc_osx_arm64, test-data-shared is checked out with LFS (and git-lfs is installed) even though build-core-steps.yml doesn’t reference test-data-shared, and Core tests are currently skipped for osx-arm64 (per the build-core template condition). If the checkout is only needed for tests, consider removing the brew install git-lfs + checkout: test-data-shared here to reduce job time and bandwidth until osx-arm64 tests are re-enabled.

Suggested change
# AcesShared macOS agents don't have git-lfs pre-installed
- script: brew install git-lfs && git lfs install
displayName: 'Install Git LFS'
- checkout: neutron-server
clean: true
- checkout: test-data-shared
lfs: true
- checkout: neutron-server
clean: true

Copilot uses AI. Check for mistakes.
- template: .pipelines/templates/build-core-steps.yml@self
parameters:
flavor: osx-arm64
Expand Down Expand Up @@ -669,6 +676,30 @@ extends:
flcNugetDir: '$(Pipeline.Workspace)/flc-nuget'
depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-standard'

- job: test_cs_win_arm64
displayName: 'win-arm64'
pool:
name: onnxruntime-native-arm64-16core
os: windows
templateContext:
inputs:
- input: pipelineArtifact
artifactName: 'flc-nuget'
targetPath: '$(Pipeline.Workspace)/flc-nuget'
- input: pipelineArtifact
artifactName: 'deps-versions-standard'
targetPath: '$(Pipeline.Workspace)/deps-versions-standard'
steps:
- checkout: self
clean: true
- checkout: test-data-shared
lfs: true
- template: .pipelines/templates/test-cs-steps.yml@self
parameters:
isWinML: false
flcNugetDir: '$(Pipeline.Workspace)/flc-nuget'
depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-standard'

- job: test_cs_linux_x64
displayName: 'linux-x64'
pool:
Expand Down Expand Up @@ -709,6 +740,9 @@ extends:
artifactName: 'deps-versions-standard'
targetPath: '$(Pipeline.Workspace)/deps-versions-standard'
steps:
# AcesShared macOS agents don't have git-lfs pre-installed
- script: brew install git-lfs && git lfs install
displayName: 'Install Git LFS'
- checkout: self
clean: true
- checkout: test-data-shared
Expand Down Expand Up @@ -748,6 +782,30 @@ extends:
flcNugetDir: '$(Pipeline.Workspace)/flc-nuget'
depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-standard'

- job: test_js_win_arm64
displayName: 'win-arm64'
pool:
name: onnxruntime-native-arm64-16core
os: windows
templateContext:
inputs:
- input: pipelineArtifact
artifactName: 'flc-nuget'
targetPath: '$(Pipeline.Workspace)/flc-nuget'
- input: pipelineArtifact
artifactName: 'deps-versions-standard'
targetPath: '$(Pipeline.Workspace)/deps-versions-standard'
steps:
- checkout: self
clean: true
- checkout: test-data-shared
lfs: true
- template: .pipelines/templates/test-js-steps.yml@self
parameters:
isWinML: false
flcNugetDir: '$(Pipeline.Workspace)/flc-nuget'
depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-standard'

# The Linux JS test job is currently disabled due to intermittent SSL errors when running get_model_list. This issue is under investigation.
# Error: Command 'get_model_list' failed: Error: System.Net.Http.HttpRequestException: An error occurred while sending the request.
# ---> System.IO.IOException: The decryption operation failed, see inner exception.
Expand Down Expand Up @@ -793,6 +851,9 @@ extends:
artifactName: 'deps-versions-standard'
targetPath: '$(Pipeline.Workspace)/deps-versions-standard'
steps:
# AcesShared macOS agents don't have git-lfs pre-installed
- script: brew install git-lfs && git lfs install
displayName: 'Install Git LFS'
- checkout: self
clean: true
- checkout: test-data-shared
Expand Down Expand Up @@ -836,11 +897,11 @@ extends:
sdkWheelsDir: '$(Pipeline.Workspace)/python-sdk'
depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-standard'

- job: test_python_linux_x64
displayName: 'linux-x64'
- job: test_python_win_arm64
displayName: 'win-arm64'
pool:
name: onnxruntime-Ubuntu2404-AMD-CPU
os: linux
name: onnxruntime-native-arm64-16core
os: windows
templateContext:
inputs:
- input: pipelineArtifact
Expand All @@ -864,6 +925,36 @@ extends:
sdkWheelsDir: '$(Pipeline.Workspace)/python-sdk'
depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-standard'

# Linux Python tests are disabled due to native dependency resolution issues
# (onnxruntime-gpu / onnxruntime-genai-cuda not found correctly on CI agents).
# - job: test_python_linux_x64
# displayName: 'linux-x64'
# pool:
# name: onnxruntime-Ubuntu2404-AMD-CPU
# os: linux
# templateContext:
# inputs:
# - input: pipelineArtifact
# artifactName: 'flc-wheels'
# targetPath: '$(Pipeline.Workspace)/flc-wheels'
# - input: pipelineArtifact
# artifactName: 'python-sdk'
# targetPath: '$(Pipeline.Workspace)/python-sdk'
# - input: pipelineArtifact
# artifactName: 'deps-versions-standard'
# targetPath: '$(Pipeline.Workspace)/deps-versions-standard'
# steps:
# - checkout: self
# clean: true
# - checkout: test-data-shared
# lfs: true
# - template: .pipelines/templates/test-python-steps.yml@self
# parameters:
# isWinML: false
# flcWheelsDir: '$(Pipeline.Workspace)/flc-wheels'
# sdkWheelsDir: '$(Pipeline.Workspace)/python-sdk'
# depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-standard'

- job: test_python_osx_arm64
displayName: 'osx-arm64'
pool:
Expand All @@ -883,6 +974,9 @@ extends:
artifactName: 'deps-versions-standard'
targetPath: '$(Pipeline.Workspace)/deps-versions-standard'
steps:
# AcesShared macOS agents don't have git-lfs pre-installed
- script: brew install git-lfs && git lfs install
displayName: 'Install Git LFS'
- checkout: self
clean: true
- checkout: test-data-shared
Expand Down Expand Up @@ -923,6 +1017,30 @@ extends:
flcNugetDir: '$(Pipeline.Workspace)/flc-nuget'
depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-standard'

- job: test_rust_win_arm64
displayName: 'win-arm64'
pool:
name: onnxruntime-native-arm64-16core
os: windows
templateContext:
inputs:
- input: pipelineArtifact
artifactName: 'flc-nuget'
targetPath: '$(Pipeline.Workspace)/flc-nuget'
- input: pipelineArtifact
artifactName: 'deps-versions-standard'
targetPath: '$(Pipeline.Workspace)/deps-versions-standard'
steps:
- checkout: self
clean: true
- checkout: test-data-shared
lfs: true
- template: .pipelines/templates/test-rust-steps.yml@self
parameters:
isWinML: false
flcNugetDir: '$(Pipeline.Workspace)/flc-nuget'
depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-standard'

- job: test_rust_linux_x64
displayName: 'linux-x64'
pool:
Expand Down Expand Up @@ -963,6 +1081,9 @@ extends:
artifactName: 'deps-versions-standard'
targetPath: '$(Pipeline.Workspace)/deps-versions-standard'
steps:
# AcesShared macOS agents don't have git-lfs pre-installed
- script: brew install git-lfs && git lfs install
displayName: 'Install Git LFS'
- checkout: self
clean: true
- checkout: test-data-shared
Expand Down Expand Up @@ -1002,7 +1123,7 @@ extends:
- job: flc_winml_win_arm64
displayName: 'win-arm64 (WinML)'
pool:
name: onnxruntime-Win-CPU-2022
name: onnxruntime-native-arm64-16core
os: windows
templateContext:
outputs:
Expand Down Expand Up @@ -1271,6 +1392,30 @@ extends:
flcNugetDir: '$(Pipeline.Workspace)/flc-nuget-winml'
depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-winml'

- job: test_cs_winml_win_arm64
displayName: 'win-arm64'
pool:
name: onnxruntime-native-arm64-16core
os: windows
templateContext:
inputs:
- input: pipelineArtifact
artifactName: 'flc-nuget-winml'
targetPath: '$(Pipeline.Workspace)/flc-nuget-winml'
- input: pipelineArtifact
artifactName: 'deps-versions-winml'
targetPath: '$(Pipeline.Workspace)/deps-versions-winml'
steps:
- checkout: self
clean: true
- checkout: test-data-shared
lfs: true
- template: .pipelines/templates/test-cs-steps.yml@self
parameters:
isWinML: true
flcNugetDir: '$(Pipeline.Workspace)/flc-nuget-winml'
depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-winml'

# ── Test JS SDK (WinML) ──
- stage: test_js_winml
displayName: 'Test JS (WinML)'
Expand Down Expand Up @@ -1300,6 +1445,30 @@ extends:
flcNugetDir: '$(Pipeline.Workspace)/flc-nuget-winml'
depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-winml'

- job: test_js_winml_win_arm64
displayName: 'win-arm64'
pool:
name: onnxruntime-native-arm64-16core
os: windows
templateContext:
inputs:
- input: pipelineArtifact
artifactName: 'flc-nuget-winml'
targetPath: '$(Pipeline.Workspace)/flc-nuget-winml'
- input: pipelineArtifact
artifactName: 'deps-versions-winml'
targetPath: '$(Pipeline.Workspace)/deps-versions-winml'
steps:
- checkout: self
clean: true
- checkout: test-data-shared
lfs: true
- template: .pipelines/templates/test-js-steps.yml@self
parameters:
isWinML: true
flcNugetDir: '$(Pipeline.Workspace)/flc-nuget-winml'
depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-winml'

# ── Test Python SDK (WinML) ──
- stage: test_python_winml
displayName: 'Test Python (WinML)'
Expand Down Expand Up @@ -1332,3 +1501,31 @@ extends:
flcWheelsDir: '$(Pipeline.Workspace)/flc-wheels-winml'
sdkWheelsDir: '$(Pipeline.Workspace)/python-sdk-winml'
depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-winml'

- job: test_python_winml_win_arm64
displayName: 'win-arm64'
pool:
name: onnxruntime-native-arm64-16core
os: windows
templateContext:
inputs:
- input: pipelineArtifact
artifactName: 'flc-wheels-winml'
targetPath: '$(Pipeline.Workspace)/flc-wheels-winml'
- input: pipelineArtifact
artifactName: 'python-sdk-winml'
targetPath: '$(Pipeline.Workspace)/python-sdk-winml'
- input: pipelineArtifact
artifactName: 'deps-versions-winml'
targetPath: '$(Pipeline.Workspace)/deps-versions-winml'
steps:
- checkout: self
clean: true
- checkout: test-data-shared
lfs: true
- template: .pipelines/templates/test-python-steps.yml@self
parameters:
isWinML: true
flcWheelsDir: '$(Pipeline.Workspace)/flc-wheels-winml'
sdkWheelsDir: '$(Pipeline.Workspace)/python-sdk-winml'
depsVersionsDir: '$(Pipeline.Workspace)/deps-versions-winml'
3 changes: 2 additions & 1 deletion .pipelines/templates/build-core-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ steps:
projects: '$(nsRoot)/src/FoundryLocalCore/Core/Core.csproj'
arguments: '--no-restore -r ${{ parameters.flavor }} /p:Platform=${{ parameters.platform }} /p:IncludeWebService=true /p:Configuration=Release'

- ${{ if or(eq(parameters.flavor, 'win-x64'), eq(parameters.flavor, 'linux-x64'), eq(parameters.flavor, 'osx-x64')) }}:
# FLC tests on osx-arm64 are flaky in CI, will investigate separately. Skip for now since the main goal of this job is to produce the AOT binary.
- ${{ if or(eq(parameters.flavor, 'win-x64'), eq(parameters.flavor, 'win-arm64'), eq(parameters.flavor, 'linux-x64')) }}:
- task: DotNetCoreCLI@2
displayName: 'Restore FLC Tests ${{ parameters.flavor }}'
inputs:
Expand Down
14 changes: 14 additions & 0 deletions .pipelines/templates/test-cs-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ steps:
if ($LASTEXITCODE -ne 0) { throw "Windows App SDK Runtime install failed" }
errorActionPreference: 'stop'

# Clear the NuGet global packages cache to avoid corrupt/stale packages on reused agents.
- task: PowerShell@2
displayName: 'Clear NuGet packages cache'
inputs:
targetType: inline
script: |
$cacheDir = Join-Path $env:USERPROFILE '.nuget' 'packages'
if (Test-Path $cacheDir) {
Write-Host "Clearing NuGet packages cache: $cacheDir"
Remove-Item -Recurse -Force "$cacheDir\*"
} else {
Write-Host "NuGet packages cache not found at $cacheDir, skipping."
}

- task: PowerShell@2
displayName: 'Restore & build tests'
inputs:
Expand Down
Loading