Skip to content

Commit

Permalink
Merge pull request #7379 from unoplatform/dev/jela/gitversion-perf
Browse files Browse the repository at this point in the history
ci: Improve build performance by caching the gitversion results
  • Loading branch information
jeromelaban authored Oct 25, 2021
2 parents 20deb7a + 094834f commit 5023e1f
Show file tree
Hide file tree
Showing 16 changed files with 61 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:
parameters:
vmImage: '$(linuxVMImage)'

- template: build/ci/.azure-devops-pipeline-validations.yml
parameters:
vmImage: '$(linuxVMImage)'

- template: build/ci/.azure-devops-package-generic.yml
parameters:
poolName: '$(windowsScaledPool)'
Expand Down
4 changes: 2 additions & 2 deletions build/ci/.azure-devops-android-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
pool:
vmImage: ${{ parameters.vmMacOSImage }}

dependsOn: Commitsar
dependsOn: Pipeline_Validations

variables:
CI_Build: true
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
pool:
vmImage: ${{ parameters.vmMacOSImage }}

dependsOn: Commitsar
dependsOn: Pipeline_Validations

variables:
CI_Build: true
Expand Down
2 changes: 1 addition & 1 deletion build/ci/.azure-devops-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
jobs:
- job: Documentation
displayName: 'Documentation WebSite'
dependsOn: Commitsar
dependsOn: Pipeline_Validations

pool:
vmImage: ${{ parameters.vmImage }}
Expand Down
2 changes: 1 addition & 1 deletion build/ci/.azure-devops-ios-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- job: iOS_Build
displayName: 'iOS Samples App UI Tests (Build)'

dependsOn: Commitsar
dependsOn: Pipeline_Validations

pool:
vmImage: ${{ parameters.vmImage }}
Expand Down
2 changes: 1 addition & 1 deletion build/ci/.azure-devops-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
NUGET_PACKAGES: $(build.sourcesdirectory)/.nuget
XCODE_ROOT: /Applications/Xcode_10.3.app

dependsOn: Commitsar
dependsOn: Pipeline_Validations

pool:
vmImage: ${{ parameters.vmImage }}
Expand Down
2 changes: 1 addition & 1 deletion build/ci/.azure-devops-package-generic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
displayName: 'Build Generic Binaries'
timeoutInMinutes: 90

dependsOn: Commitsar
dependsOn: Pipeline_Validations

pool: ${{ parameters.poolName }}

Expand Down
2 changes: 1 addition & 1 deletion build/ci/.azure-devops-package-net6-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

pool: ${{ parameters.poolName }}

dependsOn: Commitsar
dependsOn: Pipeline_Validations

strategy:
matrix:
Expand Down
29 changes: 29 additions & 0 deletions build/ci/.azure-devops-pipeline-validations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
parameters:
vmImage: ''

jobs:
- job: Pipeline_Validations
displayName: 'Pipeline Validations'
dependsOn: Commitsar

strategy:
matrix:
Ubuntu:
localVmImage: 'ubuntu-latest'

Windows:
localVmImage: 'windows-latest'

macOS:
localVmImage: 'macos-latest'

pool:
vmImage: $(localVmImage)

steps:
- checkout: self
clean: true

- template: templates/gitversion.yml
parameters:
skipCacheDownload: true
2 changes: 1 addition & 1 deletion build/ci/.azure-devops-samplesapp-uitests-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
pool:
vmImage: ${{ parameters.vmImage }}

dependsOn: Commitsar
dependsOn: Pipeline_Validations

variables:
NUGET_PACKAGES: $(build.sourcesdirectory)/.nuget
Expand Down
2 changes: 1 addition & 1 deletion build/ci/.azure-devops-skia-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
pool:
vmImage: ${{ parameters.vmImage }}

dependsOn: Commitsar
dependsOn: Pipeline_Validations

variables:
CombinedConfiguration: Release|Any CPU
Expand Down
2 changes: 1 addition & 1 deletion build/ci/.azure-devops-uap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
pool:
vmImage: ${{ parameters.vmImage }}

dependsOn: Commitsar
dependsOn: Pipeline_Validations

variables:
CombinedConfiguration: Release|Any CPU
Expand Down
2 changes: 1 addition & 1 deletion build/ci/.azure-devops-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
pool:
vmImage: ${{ parameters.vmImage }}

dependsOn: Commitsar
dependsOn: Pipeline_Validations

strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion build/ci/.azure-devops-vs2022-vsix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
CombinedConfiguration: Release|Any CPU
CI_Build: true

dependsOn: Commitsar
dependsOn: Pipeline_Validations

steps:
- checkout: self
Expand Down
2 changes: 1 addition & 1 deletion build/ci/.azure-devops-wasm-cs9-preview-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
pool:
vmImage: ${{ parameters.vmImage }}

dependsOn: Commitsar
dependsOn: Pipeline_Validations

variables:
NUGET_PACKAGES: $(build.sourcesdirectory)/.nuget
Expand Down
2 changes: 1 addition & 1 deletion build/ci/.azure-devops-wasm-uitests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
displayName: 'WebAssembly UI Tests (Build)'
container: nv-bionic-wasm

dependsOn: Commitsar
dependsOn: Pipeline_Validations

pool:
vmImage: ${{ parameters.vmImage }}
Expand Down
14 changes: 14 additions & 0 deletions build/ci/templates/gitversion.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
parameters:
dotnetInstallationPath: ''
skipCacheDownload: ''

steps:

- task: DownloadBuildArtifacts@0
condition: ne('${{parameters.skipCacheDownload}}', 'true')
displayName: 'Download GitVersion Cache'
inputs:
artifactName: gitversion_cache
downloadPath: '$(build.sourcesdirectory)/.git'

# This step changes the PR version ID so that produced nuget packages can be tied
# to specific builds. This can be used to create canaries from PR artifacts.
- powershell: |
Expand Down Expand Up @@ -55,3 +63,9 @@ steps:
condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Update GITVERSION.SemVer for PullRequests
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(build.sourcesdirectory)/.git/gitversion_cache
ArtifactName: gitversion_cache
ArtifactType: Container

0 comments on commit 5023e1f

Please sign in to comment.