Skip to content

Commit 58f970a

Browse files
committed
Reduce build duplication in pipelines
- build native assets and repo tasks once per CI job - only cleanup framework references after packing managed projects nits: - remove default `-arch x64` option - wrap a few long lines - remove extra `-forceCoreMsbuild` options in SiteExtensions' build.cmd
1 parent d21ed93 commit 58f970a

File tree

6 files changed

+39
-31
lines changed

6 files changed

+39
-31
lines changed

.azure/pipelines/ci.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ variables:
4747
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
4848
- group: DotNet-MSRC-Storage
4949
- name: _InternalRuntimeDownloadArgs
50-
value: -DotNetRuntimeSourceFeed https://dotnetclimsrc.blob.core.windows.net/dotnet -DotNetRuntimeSourceFeedKey $(dotnetclimsrc-read-sas-token-base64) /p:DotNetAssetRootAccessTokenSuffix='$(dotnetclimsrc-read-sas-token-base64)'
50+
value: -DotNetRuntimeSourceFeed https://dotnetclimsrc.blob.core.windows.net/dotnet -DotNetRuntimeSourceFeedKey
51+
$(dotnetclimsrc-read-sas-token-base64) /p:DotNetAssetRootAccessTokenSuffix='$(dotnetclimsrc-read-sas-token-base64)'
5152
# The code signing doesn't use the aspnet build scripts, so the msbuild parameters have
5253
# to be passed directly. This is awkward, since we pass the same info above, but we have
5354
# to have it in two different forms
@@ -140,32 +141,35 @@ stages:
140141
- script: ./build.cmd
141142
-ci
142143
-nobl
144+
-noBuildRepoTasks
143145
-arch x86
144146
-pack
145147
-all
146148
-noBuildJava
149+
-noBuildNative
147150
/p:OnlyPackPlatformSpecificPackages=true
148151
$(_BuildArgs)
149152
$(_InternalRuntimeDownloadArgs)
150153
displayName: Build x86
151154

152-
# This is in a separate build step with -forceCoreMsbuild to workaround MAX_PATH limitations - https://github.com/Microsoft/msbuild/issues/53
153155
- script: .\src\SiteExtensions\build.cmd
154156
-ci
155157
-nobl
158+
-noBuildRepoTasks
156159
-pack
157160
-noBuildDeps
158161
$(_BuildArgs)
159162
$(_InternalRuntimeDownloadArgs)
160163
condition: ne(variables['Build.Reason'], 'PullRequest')
161164
displayName: Build SiteExtension
162165

163-
# This runs code-signing on all packages, zips, and jar files as defined in build/CodeSign.targets. If https://github.com/dotnet/arcade/issues/1957 is resolved,
164-
# consider running code-signing inline with the other previous steps.
165-
# Sign check is disabled because it is run in a separate step below, after installers are built.
166+
# This runs code-signing on all packages, zips, and jar files as defined in build/CodeSign.targets. If
167+
# https://github.com/dotnet/arcade/issues/1957 is resolved, consider running code-signing inline with the other
168+
# previous steps. Sign check is disabled because it is run in a separate step below, after installers are built.
166169
- script: ./build.cmd
167170
-ci
168171
-nobl
172+
-noBuildRepoTasks
169173
-noBuild
170174
-noRestore
171175
-sign
@@ -177,6 +181,7 @@ stages:
177181
- script: ./build.cmd
178182
-ci
179183
-nobl
184+
-noBuildRepoTasks
180185
-sign
181186
-buildInstallers
182187
/p:DotNetSignType=$(_SignType)
@@ -305,7 +310,6 @@ stages:
305310
- script: ./build.sh
306311
--ci
307312
--nobl
308-
--arch x64
309313
--pack
310314
--all
311315
--no-build-nodejs
@@ -319,7 +323,6 @@ stages:
319323
./dockerbuild.sh bionic \
320324
--ci \
321325
--nobl \
322-
--arch x64 \
323326
--build-installers \
324327
--no-build-deps \
325328
--no-build-nodejs \
@@ -334,7 +337,6 @@ stages:
334337
./dockerbuild.sh rhel \
335338
--ci \
336339
--nobl \
337-
--arch x64 \
338340
--build-installers \
339341
--no-build-deps \
340342
--no-build-nodejs \
@@ -427,7 +429,6 @@ stages:
427429
agentOs: Linux
428430
buildScript: ./dockerbuild.sh alpine
429431
buildArgs:
430-
--arch x64
431432
--os-name linux-musl
432433
--pack
433434
--all
@@ -492,7 +493,9 @@ stages:
492493
jobDisplayName: "Test: Windows Server 2016 x64"
493494
agentOs: Windows
494495
isTestingJob: true
495-
buildArgs: -all -pack -test "/p:SkipHelixReadyTests=true /p:SkipIISNewHandlerTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISNewShimTests=true /p:RunTemplateTests=false" $(_InternalRuntimeDownloadArgs)
496+
buildArgs: -all -pack -test /p:SkipHelixReadyTests=true /p:SkipIISNewHandlerTests=true /p:SkipIISTests=true
497+
/p:SkipIISExpressTests=true /p:SkipIISNewShimTests=true /p:RunTemplateTests=false
498+
$(_InternalRuntimeDownloadArgs)
496499
beforeBuild:
497500
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1"
498501
displayName: Setup IISExpress test certificates and schema
@@ -530,9 +533,9 @@ stages:
530533
steps:
531534
- script: ./build.cmd -ci -nobl -all -pack $(_InternalRuntimeDownloadArgs)
532535
displayName: Build Repo
533-
- script: ./src/ProjectTemplates/build.cmd -ci -nobl -pack -NoRestore -NoBuilddeps "/p:RunTemplateTests=true"
536+
- script: ./src/ProjectTemplates/build.cmd -ci -nobl -noBuildRepoTasks -pack -NoRestore -NoBuilddeps "/p:RunTemplateTests=true"
534537
displayName: Pack Templates
535-
- script: ./src/ProjectTemplates/build.cmd -ci -nobl -test -NoRestore -NoBuild -NoBuilddeps "/p:RunTemplateTests=true"
538+
- script: ./src/ProjectTemplates/build.cmd -ci -nobl -noBuildRepoTasks -test -NoRestore -NoBuild -NoBuilddeps "/p:RunTemplateTests=true"
536539
displayName: Test Templates
537540
artifacts:
538541
- name: Windows_Test_Templates_Dumps
@@ -630,11 +633,13 @@ stages:
630633
timeoutInMinutes: 180
631634
steps:
632635
# Build the shared framework
633-
- script: ./build.cmd -ci -nobl -all -pack -arch x64 /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
636+
- script: ./build.cmd -ci -nobl -all -pack /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
634637
displayName: Build shared fx
635638
- script: .\restore.cmd -ci -nobl /p:BuildInteropProjects=true
636639
displayName: Restore interop projects
637-
- script: .\build.cmd -ci -nobl -NoRestore -test -all -projects eng\helix\helix.proj /p:IsRequiredCheck=true /p:IsHelixJob=true /p:BuildInteropProjects=true /p:RunTemplateTests=true /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
640+
- script: ./build.cmd -ci -nobl -noBuildRepoTasks -noRestore -test -all -noBuildNative -projects eng\helix\helix.proj
641+
/p:IsRequiredCheck=true /p:IsHelixJob=true /p:BuildInteropProjects=true /p:RunTemplateTests=true
642+
/p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
638643
displayName: Run build.cmd helix target
639644
env:
640645
HelixApiAccessToken: $(HelixApiAccessToken) # Needed for internal queues

.azure/pipelines/devBuilds.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ stages:
3131
steps:
3232
- script: ./build.cmd
3333
-ci
34-
-arch x64
3534
/bl:artifacts/log/build.components.x64.binlog
3635
displayName: Build x64
3736
workingDirectory: ./src/Components
@@ -54,7 +53,6 @@ stages:
5453
steps:
5554
- script: ./build.cmd
5655
-ci
57-
-arch x64
5856
/bl:artifacts/log/build.servers.x64.binlog
5957
displayName: Build x64
6058
workingDirectory: ./src/Servers
@@ -77,7 +75,6 @@ stages:
7775
steps:
7876
- script: ./build.cmd
7977
-ci
80-
-arch x64
8178
/bl:artifacts/log/build.projectTemplates.x64.binlog
8279
displayName: Build x64
8380
workingDirectory: ./src/ProjectTemplates
@@ -100,7 +97,6 @@ stages:
10097
steps:
10198
- script: ./build.cmd
10299
-ci
103-
-arch x64
104100
/bl:artifacts/log/build.all.x64.binlog
105101
displayName: Build x64
106102
artifacts:

.azure/pipelines/helix-matrix.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ schedules:
77
include:
88
- master
99
always: true
10-
10+
1111
variables:
1212
- ${{ if ne(variables['System.TeamProject'], 'internal') }}:
1313
- name: _UseHelixOpenQueues
1414
value: 'true'
1515
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
1616
- group: DotNet-HelixApi-Access
1717
- name: _UseHelixOpenQueues
18-
value: 'false'
19-
18+
value: 'false'
19+
2020
jobs:
2121
- template: jobs/default-build.yml
2222
parameters:
@@ -26,11 +26,13 @@ jobs:
2626
timeoutInMinutes: 240
2727
steps:
2828
# Build the shared framework
29-
- script: ./build.cmd -ci -nobl -all -pack -arch x64 /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
29+
- script: ./build.cmd -ci -nobl -all -pack /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
3030
displayName: Build shared fx
3131
- script: .\restore.cmd -ci /p:BuildInteropProjects=true
3232
displayName: Restore interop projects
33-
- script: .\build.cmd -ci -nobl -NoRestore -test -all -projects eng\helix\helix.proj /p:IsHelixDaily=true /p:IsRequiredCheck=true /p:IsHelixJob=true /p:BuildInteropProjects=true /p:RunTemplateTests=true /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
33+
- script: .\build.cmd -ci -nobl -NoRestore -test -all -projects eng\helix\helix.proj
34+
/p:IsHelixDaily=true /p:IsRequiredCheck=true /p:IsHelixJob=true /p:BuildInteropProjects=true
35+
/p:RunTemplateTests=true /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
3436
displayName: Run build.cmd helix target
3537
env:
3638
HelixApiAccessToken: $(HelixApiAccessToken) # Needed for internal queues
@@ -39,7 +41,7 @@ jobs:
3941
- name: Helix_logs
4042
path: artifacts/log/
4143
publishOnError: true
42-
44+
4345
# Helix ARM64
4446
- template: jobs/default-build.yml
4547
parameters:
@@ -50,7 +52,9 @@ jobs:
5052
steps:
5153
- script: ./restore.sh -ci -nobl
5254
displayName: Restore
53-
- script: ./build.sh -ci --nobl --arch arm64 -test --no-build-nodejs --all -projects $(Build.SourcesDirectory)/eng/helix/helix.proj /p:IsHelixJob=true /p:IsHelixDaily=true /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
55+
- script: ./build.sh -ci --nobl --arch arm64 -test --no-build-nodejs --all -projects
56+
$(Build.SourcesDirectory)/eng/helix/helix.proj /p:IsHelixJob=true /p:IsHelixDaily=true
57+
/p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
5458
displayName: Run build.sh helix arm64 target
5559
env:
5660
HelixApiAccessToken: $(HelixApiAccessToken) # Needed for internal queues

.azure/pipelines/quarantined-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ jobs:
3131
timeoutInMinutes: 240
3232
steps:
3333
# Build the shared framework
34-
- script: ./build.cmd -ci -all -pack -arch x64 /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log /bl:artifacts/log/helix.build.x64.binlog
34+
- script: ./build.cmd -ci -all -pack /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log /bl:artifacts/log/helix.build.x64.binlog
3535
displayName: Build shared fx
3636
- script: .\restore.cmd -ci /p:BuildInteropProjects=true
3737
displayName: Restore interop projects
38-
- script: .\build.cmd -ci -NoRestore -test -noBuildJava -all -projects eng\helix\helix.proj /p:RunQuarantinedTests=true /p:IsRequiredCheck=true /p:IsHelixJob=true /p:BuildInteropProjects=true /p:RunTemplateTests=true /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log -bl
38+
- script: ./build.cmd -ci -noRestore -test -all -noBuildJava -noBuildNative -projects eng\helix\helix.proj
39+
/p:RunQuarantinedTests=true /p:IsRequiredCheck=true /p:IsHelixJob=true /p:BuildInteropProjects=true
40+
/p:RunTemplateTests=true /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
3941
displayName: Run build.cmd helix target
4042
env:
4143
HelixApiAccessToken: $(HelixApiAccessToken) # Needed for internal queues

eng/AfterSolutionBuild.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<Import Project="SharedFramework.Local.props" />
66

77
<!-- This is temporary until we can use FrameworkReference to build our own packages. -->
8-
<Target Name="RemoveSharedFrameworkOnlyRefsFromNuspec" AfterTargets="Pack">
8+
<Target Name="RemoveSharedFrameworkOnlyRefsFromNuspec" AfterTargets="Pack"
9+
Condition=" '$(MSBuildRuntimeType)' == 'core' ">
910
<ItemGroup>
1011
<_BuildOutput Include="$(ArtifactsShippingPackagesDir)*.nupkg"
1112
Exclude="$(ArtifactsShippingPackagesDir)*.symbols.nupkg" />

src/SiteExtensions/build.cmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ IF %ERRORLEVEL% NEQ 0 (
1818
ECHO Building x64 LoggingBranch
1919
REM /p:DisableTransitiveFrameworkReferences=true is needed to prevent SDK from picking up transitive references to
2020
REM Microsoft.AspNetCore.App as framework references https://github.com/dotnet/sdk/pull/3221
21-
CALL "%RepoRoot%\build.cmd" -forceCoreMsbuild -arch x64 -projects "%~dp0LoggingBranch\LB.csproj" ^
21+
CALL "%RepoRoot%\build.cmd" -arch x64 -projects "%~dp0LoggingBranch\LB.csproj" ^
2222
/p:DisableTransitiveFrameworkReferences=true /bl:artifacts/log/SiteExtensions-LoggingBranch-x64.binlog %*
2323
IF %ERRORLEVEL% NEQ 0 (
2424
EXIT /b %ErrorLevel%
2525
)
2626

2727
ECHO Building x86 LoggingBranch
28-
CALL "%RepoRoot%\build.cmd" -forceCoreMsbuild -arch x86 -projects "%~dp0LoggingBranch\LB.csproj" ^
28+
CALL "%RepoRoot%\build.cmd" -arch x86 -projects "%~dp0LoggingBranch\LB.csproj" ^
2929
/p:DisableTransitiveFrameworkReferences=true /bl:artifacts/log/SiteExtensions-LoggingBranch-x86.binlog %*
3030
IF %ERRORLEVEL% NEQ 0 (
3131
EXIT /b %ErrorLevel%
3232
)
3333

3434
ECHO Building Microsoft.AspNetCore.AzureAppServices.SiteExtension
35-
CALL "%RepoRoot%\build.cmd" -forceCoreMsbuild -projects ^
35+
CALL "%RepoRoot%\build.cmd" -projects ^
3636
"%~dp0LoggingAggregate\src\Microsoft.AspNetCore.AzureAppServices.SiteExtension\Microsoft.AspNetCore.AzureAppServices.SiteExtension.csproj" ^
3737
/bl:artifacts/log/SiteExtensions-LoggingAggregate.binlog %*
3838
IF %ERRORLEVEL% NEQ 0 (

0 commit comments

Comments
 (0)