From 494ba17ba1ff8e000eff3b74e076261bcb90bed2 Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Tue, 10 Oct 2023 10:19:47 +0300 Subject: [PATCH] ci: CI improvements --- build/.azure-pipelines.TemplateValidation.yml | 1 - build/.azure-pipelines.yml | 8 ++++++-- build/templates/package-validation.yml | 8 +++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/build/.azure-pipelines.TemplateValidation.yml b/build/.azure-pipelines.TemplateValidation.yml index b5d9030a5..0ec2b8f54 100644 --- a/build/.azure-pipelines.TemplateValidation.yml +++ b/build/.azure-pipelines.TemplateValidation.yml @@ -1,6 +1,5 @@ jobs: - job: Packages_Validation - dependsOn: Packages pool: vmImage: 'windows-2022' diff --git a/build/.azure-pipelines.yml b/build/.azure-pipelines.yml index 4b905e26a..98da39c6e 100644 --- a/build/.azure-pipelines.yml +++ b/build/.azure-pipelines.yml @@ -17,9 +17,8 @@ variables: IsCanaryBranch: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/canaries/')] stages: -- stage: Build +- stage: Packaging jobs: - - template: .azure-pipelines.TemplateValidation.yml - job: Packages pool: @@ -61,9 +60,14 @@ stages: ArtifactName: $(Build.DefinitionName) ArtifactType: Container +- stage: Template_validations + dependsOn: Packaging + jobs: + - template: .azure-pipelines.TemplateValidation.yml - stage: Prepare condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['IsCanaryBranch'], true))) + dependsOn: Packaging jobs: - job: Sign diff --git a/build/templates/package-validation.yml b/build/templates/package-validation.yml index d6bd8146e..5ecd9a94f 100644 --- a/build/templates/package-validation.yml +++ b/build/templates/package-validation.yml @@ -65,19 +65,21 @@ steps: parameters: MergeBranch: false +- powershell: | + & dotnet workload restore --from-rollback-file $(WorkloadRestore) --skip-sign-check + displayName: Restore workloads + - powershell: | Set-PSDebug -Trace 1 $ErrorActionPreference = 'Stop' cd UnoApp1 - & dotnet workload restore --from-rollback-file $(WorkloadRestore) --skip-sign-check & dotnet build UnoApp1.sln "/bl:$(build.artifactstagingdirectory)\$(Agent.JobName).binlog" if ($LASTEXITCODE -ne 0) { throw "Exit code must be zero." } - cd .. displayName: Build template app @@ -87,4 +89,4 @@ steps: inputs: PathtoPublish: $(build.artifactstagingdirectory) ArtifactName: logs - ArtifactType: Container \ No newline at end of file + ArtifactType: Container