Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Internal build: build packages, and workload nugets only once #5417

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 35 additions & 29 deletions eng/pipelines/templates/BuildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,41 @@ parameters:
default: false

steps:
- script: ${{ parameters.buildScript }}
-restore -build
-pack
-configuration ${{ parameters.buildConfig }}
/p:ArchiveTests=true
/bl:${{ parameters.repoLogPath }}/build.binlog
$(_OfficialBuildIdArgs)
displayName: Build
# Internal pipeline: Build with pack+sign+archive
- ${{ if ne(parameters.runAsPublic, 'true') }}:
- script: ${{ parameters.buildScript }}
-restore -build
-pack
-sign $(_SignArgs)
Copy link
Member

Choose a reason for hiding this comment

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

NIT: Do we need to sign here? Can't we just keep the -sign param on the workloads build and have that sign everything?

Copy link
Member Author

Choose a reason for hiding this comment

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

TBD: follow up

-publish $(_PublishArgs)
-configuration ${{ parameters.buildConfig }}
/p:ArchiveTests=true
/bl:${{ parameters.repoLogPath }}/build.binlog
$(_OfficialBuildIdArgs)
displayName: Build

# Public pipeline - helix tests
- ${{ if eq(parameters.runAsPublic, 'true') }}:
- script: ${{ parameters.buildScript }}
-restore -build
-configuration ${{ parameters.buildConfig }}
-pack
/p:ArchiveTests=${{ lower(eq(parameters.runHelixTests, 'true')) }}
/bl:${{ parameters.repoLogPath }}/build.binlog
$(_OfficialBuildIdArgs)
displayName: Build

# Run on windows, either for internal pipeline, or for public+non-helix-tests job
- ${{ if and(eq(parameters.isWindows, 'true'), or(ne(parameters.runAsPublic, 'true'), ne(parameters.runHelixTests, 'true'))) }}:
- script: ${{ parameters.buildScript }}
-restore -build
-sign $(_SignArgs)
-publish $(_PublishArgs)
-configuration $(_BuildConfig)
/bl:${{ parameters.repoLogPath }}/build-workloads.binlog
-projects eng\workloads\workloads.csproj
$(_InternalBuildArgs)
displayName: Build Workloads

- ${{ if or(ne(parameters.runAsPublic, 'true'), ne(parameters.runHelixTests, 'true')) }}:
- ${{ if ne(parameters.isWindows, 'true') }}:
Expand Down Expand Up @@ -124,27 +151,6 @@ steps:

# Run on windows, for internal pipeline, or public+non-helix-tests job
- ${{ if and(eq(parameters.isWindows, 'true'), or(ne(parameters.runAsPublic, 'true'), ne(parameters.runHelixTests, 'true'))) }}:
- script: ${{ parameters.buildScript }}
-pack
-sign $(_SignArgs)
-publish $(_PublishArgs)
-configuration ${{ parameters.buildConfig }}
/bl:${{ parameters.repoLogPath }}/pack.binlog
/p:Restore=false /p:Build=false
$(_OfficialBuildIdArgs)
displayName: Pack, Sign, and Publish

- script: ${{ parameters.buildScript }}
-restore -build
-pack
-sign $(_SignArgs)
-publish $(_PublishArgs)
-configuration $(_BuildConfig)
/bl:${{ parameters.repoLogPath }}/build-workloads.binlog
-projects eng\workloads\workloads.csproj
$(_InternalBuildArgs)
displayName: Build Workloads

- ${{ if eq(parameters.runAsPublic, 'true') }}:
- task: PublishPipelineArtifact@1
displayName: Publish VSDrop MSIs
Expand Down
9 changes: 7 additions & 2 deletions tests/Shared/Aspire.Workload.Testing.targets
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,15 @@
<UnexpectedPackages Include="@(AllPackages)" Exclude="@(ExpectedPackagePaths)" />

<!-- Ignore these packages which are part of the workload. Existence of these would get checked
by the workload installation targets. And their names don't correspond to project names. -->
by the workload installation targets. -->
<UnexpectedPackages Remove="@(UnexpectedPackages)" Condition="$([System.String]::Copy('%(UnexpectedPackages.FileName)').StartsWith('Aspire.Hosting.Sdk.'))" />
<UnexpectedPackages Remove="@(UnexpectedPackages)" Condition="$([System.String]::Copy('%(UnexpectedPackages.FileName)').StartsWith('Aspire.ProjectTemplates.'))" />
<UnexpectedPackages Remove="@(UnexpectedPackages)" Condition="$([System.String]::Copy('%(UnexpectedPackages.FileName)').StartsWith('Microsoft.NET.Sdk.Aspire.Manifest-'))" />
<UnexpectedPackages Remove="@(UnexpectedPackages)" Condition="$([System.String]::Copy('%(UnexpectedPackages.FileName)').StartsWith('Aspire.Hosting.Orchestration.'))" />

<!-- Exclude the packages with arch-specific nugets -->
<UnexpectedPackages Remove="@(UnexpectedPackages)" Condition="$([System.String]::Copy('%(UnexpectedPackages.FileName)').StartsWith('Aspire.Dashboard.Sdk.'))" />
<UnexpectedPackages Remove="@(UnexpectedPackages)" Condition="$([System.String]::Copy('%(UnexpectedPackages.FileName)').StartsWith('Aspire.Hosting.Orchestration.'))" />

</ItemGroup>

<Warning Text="Found some unexpected packages in '$(ArtifactsShippingPackagesDir)', which might mean that the list of expected packages is incorrect: @(UnexpectedPackages -> '%(FileName)%(Extension)', ', '). Use %24(SkipPackageCheckForWorkloadTesting)='true' to skip this."
Expand Down