Skip to content

Commit 52e30a4

Browse files
build: TFM sequentially (#3119)
Release-As: 6.0.2
1 parent c929484 commit 52e30a4

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

.azure-pipelines/ci-build.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,21 +92,42 @@ extends:
9292
Write-Host "Updated the .csproj files so that we can sign the built assemblies."
9393
workingDirectory: src
9494
displayName: 'Set project ready to sign'
95+
96+
# Build each TFM sequentially to avoid OOM kills on the build agent.
97+
# Building all TFMs in parallel exhausts memory on standard runners (exit code 137).
9598
- task: DotNetCoreCLI@2
96-
displayName: 'Build project'
99+
displayName: 'dotnet build netstandard2.0'
97100
inputs:
98101
projects: '$(Build.SourcesDirectory)\src\Microsoft.Graph\Microsoft.Graph.csproj'
99-
arguments: '-c $(BuildConfiguration) --no-incremental --no-restore'
102+
arguments: '-c $(BuildConfiguration) --no-incremental -f netstandard2.0 --no-restore'
100103
- task: DotNetCoreCLI@2
101-
displayName: 'Build test project'
104+
displayName: 'dotnet build netstandard2.1'
105+
inputs:
106+
projects: '$(Build.SourcesDirectory)\src\Microsoft.Graph\Microsoft.Graph.csproj'
107+
arguments: '-c $(BuildConfiguration) --no-incremental -f netstandard2.1 --no-restore'
108+
- task: DotNetCoreCLI@2
109+
displayName: 'dotnet build net8.0'
110+
inputs:
111+
projects: '$(Build.SourcesDirectory)\src\Microsoft.Graph\Microsoft.Graph.csproj'
112+
arguments: '-c $(BuildConfiguration) --no-incremental -f net8.0 --no-restore'
113+
- task: DotNetCoreCLI@2
114+
displayName: 'dotnet build net10.0'
115+
inputs:
116+
projects: '$(Build.SourcesDirectory)\src\Microsoft.Graph\Microsoft.Graph.csproj'
117+
arguments: '-c $(BuildConfiguration) --no-incremental -f net10.0 --no-restore'
118+
119+
- task: DotNetCoreCLI@2
120+
displayName: 'dotnet build test project'
102121
inputs:
103122
projects: '$(Build.SourcesDirectory)\tests\Microsoft.Graph.DotnetCore.Test\Microsoft.Graph.DotnetCore.Test.csproj'
104123
arguments: '-c $(BuildConfiguration) --no-incremental --no-restore'
124+
105125
- task: DotNetCoreCLI@2
106126
displayName: 'run tests'
107127
inputs:
108128
command: 'test'
109129
arguments: '--configuration $(BuildConfiguration) --verbosity normal --no-build'
130+
110131
- task: PowerShell@2
111132
displayName: 'Validate updated version'
112133
condition: and(contains(variables['build.sourceBranch'], 'refs/heads/main'), succeeded())

0 commit comments

Comments
 (0)