Skip to content

Commit f8cc7e7

Browse files
authored
update CI to use window-latest image and fix local caching (#823)
* use windows-latest pool * fix vcpkg dependency download * fix typo * Fix folder variable assignment in build script * fix syntax * use vcpkg cache * use param, not variable * add single var declaration * configure cache in install job
1 parent 830099f commit f8cc7e7

3 files changed

Lines changed: 23 additions & 14 deletions

File tree

.azdo/ci.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,34 @@ pr:
1010
include:
1111
- latestw_all
1212

13+
variables:
14+
vcpkgCacheDir: '$(Build.SourcesDirectory)/binary-cache'
15+
1316
stages:
1417
- stage: BuildDependencies
1518
displayName: Build Dependencies
1619
jobs:
1720
- job: InstallDeps_x64
1821
displayName: Install vcpkg Dependencies (x64)
1922
pool:
20-
name: PS-PowerShell-x64
21-
demands:
22-
- ImageOverride -equals PSMMS2022-OpenSSH-Secure
23+
vmImage: windows-latest
2324
steps:
2425
- template: ./templates/install-vcpkg-dependencies.yml
2526
parameters:
2627
triplet: x64-custom
2728
artifactSuffix: x64
29+
vcpkgCacheDir: '$(vcpkgCacheDir)'
2830

2931
- job: InstallDeps_x86
3032
displayName: Install vcpkg Dependencies (x86)
3133
pool:
32-
name: PS-PowerShell-x64
33-
demands:
34-
- ImageOverride -equals PSMMS2022-OpenSSH-Secure
34+
vmImage: windows-latest
3535
steps:
3636
- template: ./templates/install-vcpkg-dependencies.yml
3737
parameters:
3838
triplet: x86-custom
3939
artifactSuffix: x86
40+
vcpkgCacheDir: '$(vcpkgCacheDir)'
4041

4142
- stage: Build
4243
displayName: Build Win32-OpenSSH
@@ -45,9 +46,7 @@ stages:
4546
- job: BuildPkg_x64
4647
displayName: Build Package (x64)
4748
pool:
48-
name: PS-PowerShell-x64
49-
demands:
50-
- ImageOverride -equals PSMMS2022-OpenSSH-Secure
49+
vmImage: windows-latest
5150
steps:
5251
- template: ./templates/build-win32-openssh-job.yml
5352
parameters:
@@ -56,20 +55,20 @@ stages:
5655
artifactSuffix: x64
5756
dependenciesArtifactName: vcpkg-dependencies-x64
5857
includeConfig: true
58+
vcpkgCacheDir: '$(vcpkgCacheDir)'
5959

6060
- job: BuildPkg_x86
6161
displayName: Build Package (x86)
6262
pool:
63-
name: PS-PowerShell-x64
64-
demands:
65-
- ImageOverride -equals PSMMS2022-OpenSSH-Secure
63+
vmImage: windows-latest
6664
steps:
6765
- template: ./templates/build-win32-openssh-job.yml
6866
parameters:
6967
nativeHostArch: x86
7068
buildOutputDir: Win32
7169
artifactSuffix: x86
7270
dependenciesArtifactName: vcpkg-dependencies-x86
71+
vcpkgCacheDir: '$(vcpkgCacheDir)'
7372

7473
- stage: Test
7574
displayName: Test Win32-OpenSSH

.azdo/templates/build-win32-openssh-job.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ parameters:
1010
- name: includeConfig
1111
type: boolean
1212
default: false
13+
- name: vcpkgCacheDir
14+
type: string
1315

1416
steps:
1517
- pwsh: |
1618
$ErrorActionPreference = 'Stop'
19+
mkdir "${{ parameters.vcpkgCacheDir }}"
1720
git clone https://github.com/microsoft/vcpkg
1821
cd vcpkg
1922
& ./bootstrap-vcpkg.bat
@@ -25,13 +28,15 @@ steps:
2528
inputs:
2629
buildType: current
2730
artifactName: ${{ parameters.dependenciesArtifactName }}
28-
targetPath: '$(Build.SourcesDirectory)/contrib/win32/openssh/vcpkg_installed'
31+
targetPath: '${{ parameters.vcpkgCacheDir }}'
2932

3033
- pwsh: |
3134
$nativeArch = '${{ parameters.nativeHostArch }}'
3235
Import-Module -Name "$(Build.SourcesDirectory)/contrib/win32/openssh/AzDOBuildTools" -Force
3336
Invoke-AzDOBuild -NativeHostArch $nativeArch
3437
displayName: Build Win32-OpenSSH (${{ parameters.nativeHostArch }})
38+
env:
39+
VCPKG_BINARY_SOURCES: "clear;files,${{ parameters.vcpkgCacheDir }},readwrite"
3540

3641
- pwsh: |
3742
$buildOutPath = "$(Build.SourcesDirectory)/bin"

.azdo/templates/install-vcpkg-dependencies.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ parameters:
33
type: string
44
- name: artifactSuffix
55
type: string
6+
- name: vcpkgCacheDir
7+
type: string
68

79
steps:
810
- pwsh: |
@@ -26,6 +28,7 @@ steps:
2628

2729
- pwsh: |
2830
$ErrorActionPreference = 'Stop'
31+
mkdir "${{ parameters.vcpkgCacheDir }}"
2932
git clone https://github.com/microsoft/vcpkg
3033
cd vcpkg
3134
& ./bootstrap-vcpkg.bat
@@ -46,10 +49,12 @@ steps:
4649
Pop-Location
4750
}
4851
displayName: Install vcpkg dependencies (${{ parameters.triplet }})
52+
env:
53+
VCPKG_BINARY_SOURCES: "clear;files,${{ parameters.vcpkgCacheDir }},readwrite"
4954

5055
- pwsh: |
5156
$artifactSuffix = '${{ parameters.artifactSuffix }}'
52-
$vcpkgInstalledPath = "$(Build.SourcesDirectory)/contrib/win32/openssh/vcpkg_installed"
57+
$vcpkgInstalledPath = "${{ parameters.vcpkgCacheDir }}"
5358
5459
if (Test-Path -Path $vcpkgInstalledPath) {
5560
Write-Verbose -Verbose "vcpkg_installed directory contents:"

0 commit comments

Comments
 (0)