-
Notifications
You must be signed in to change notification settings - Fork 6.5k
169 lines (166 loc) · 8.18 KB
/
test_modified_ports.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Test Modified Ports
on:
push:
branches:
- onboard-actions
permissions:
id-token: write
contents: read
jobs:
test-modified-ports:
strategy:
matrix:
conf:
- triplet: 'x86-windows'
pool: windows
extra-checks: true
- triplet: 'x64-windows'
pool: windows
- triplet: 'x64-windows-static'
pool: windows
- triplet: 'x64-windows-static-md'
pool: windows
- triplet: 'x64-uwp'
pool: windows
- triplet: 'arm64-windows'
pool: windows
- triplet: 'arm64-uwp'
pool: windows
- triplet: 'x64-linux'
pool: linux
- triplet: 'arm-neon-android'
pool: android
- triplet: 'x64-android'
pool: android
- triplet: 'arm64-android'
pool: android
runs-on:
- self-hosted
- "1ES.Pool=${{ matrix.conf.pool == 'windows' && 'vcpkg-windows-wus' || matrix.conf.pool == 'linux' && 'vcpkg-linux-wus' || matrix.conf.pool == 'android' && 'vcpkg-android-wus' }}"
continue-on-error: true
timeout-minutes: 2880 # 2 days
env:
VCPKG_DOWNLOADS: ${{ matrix.conf.pool == 'windows' && 'D:\downloads' || '/mnt/vcpkg-ci/downloads' }}
WORKING_ROOT: ${{ matrix.conf.pool == 'windows' && 'D:\' || '/mnt/vcpkg-ci' }}
ARTIFACT_STAGING: ${{ matrix.conf.pool == 'windows' && 'D:\artifactstaging' || '/mnt/vcpkg-ci/artifactstaging' }}
steps:
- name: Checkout (Windows)
uses: actions/checkout@v4
if: ${{ success() && matrix.conf.pool == 'windows' }}
env:
PATH: c:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd;$PATH
with:
# fetch-depth 50 tries to ensure we capture the whole history of the branch
fetch-depth: 50
- name: Checkout (Non-Windows)
uses: actions/checkout@v4
if: ${{ success() && matrix.conf.pool != 'windows' }}
with:
# fetch-depth 50 tries to ensure we capture the whole history of the branch
fetch-depth: 50
- name: Azure Login
uses: azure/login@v2
with:
client-id: a81b4cd3-9d8d-4cb9-9a74-f2038f24f224
subscription-id: 7fcb00fa-a761-49de-8a2f-d67190e62882
tenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
- name: Bootstrap (Windows)
if: ${{ success() && matrix.conf.pool == 'windows' }}
run: ./scripts/bootstrap.ps1
- name: Bootstrap (Non-Windows)
if: ${{ success() && matrix.conf.pool != 'windows' }}
run: ./scripts/bootstrap.sh
- name: Format Manifests
if: ${{ success() && matrix.conf.extra-checks }}
run: ./vcpkg.exe format-manifest --all
- name: Create Artifact Staging Directory
run: mkdir ${{ env.ARTIFACT_STAGING }}
- name: Create Format Manifest Diff
if: ${{ success() && matrix.conf.extra-checks }}
env:
PATH: c:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd;$PATH
run: ./scripts/azure-pipelines/Create-PRDiff.ps1 -DiffFile "${{ env.ARTIFACT_STAGING }}/format.diff"
- name: 'Publish Artifact: Format Diff'
uses: actions/upload-artifact@v4
if: ${{ failure() && !cancelled() && matrix.conf.extra-checks }}
with:
name: 'format.diff'
path: "${{ env.ARTIFACT_STAGING }}/format.diff"
retention-days: 7
if-no-files-found: error
- name: "*** Test Modified Ports (non-Android)"
if: ${{ success() && matrix.conf.pool != 'android' }}
shell: pwsh
run: |
$current = Get-Date -AsUtc
$endDate = $current.AddDays(2)
$end = Get-Date -Date $endDate -UFormat '+%Y-%m-%dT%H:%MZ'
Write-Host "Getting Asset Cache SAS"
$assetSas = az storage container generate-sas --name cache --account-name vcpkgassetcachewus3 --as-user --auth-mode login --https-only --permissions rcl --expiry $end -o tsv | Out-String
if ($LastExitCode -ne 0) {
Write-Error "Failed to get Asset Cache SAS"
return 1
}
$assetSas = $assetSas.Trim()
Write-Host "Getting Binary Cache SAS"
$binarySas = az storage container generate-sas --name cache --account-name vcpkgbinarycachewus --as-user --auth-mode login --https-only --permissions rclw --expiry $end -o tsv | Out-String
if ($LastExitCode -ne 0) {
Write-Error "Failed to get Binary Cache SAS"
return 1
}
$binarySas = $binarySas.Trim()
$env:X_VCPKG_ASSET_SOURCES = "x-azurl,https://vcpkgassetcachewus3.blob.core.windows.net/cache,$assetSas,readwrite"
if ($IsWindows) { # FIXME: Git in the images
$env:PATH += ";c:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd"
}
& scripts/azure-pipelines/test-modified-ports.ps1 -Triplet ${{ matrix.conf.triplet }} -BinarySourceStub "x-azblob,https://vcpkgbinarycachewus.blob.core.windows.net/cache,$binarySas" -WorkingRoot $env:WORKING_ROOT -ArtifactStagingDirectory $env:ARTIFACT_STAGING
- name: "*** Test Modified Ports (Android)"
if: ${{ success() && matrix.conf.pool == 'android' }}
run: |
az acr login --name vcpkgandroidwus
docker pull vcpkgandroidwus.azurecr.io/vcpkg-android:2024-10-21
end=`date -u -d "2 days" '+%Y-%m-%dT%H:%MZ'`
assetSas=`az storage container generate-sas --name cache --account-name vcpkgassetcachewus3 --as-user --auth-mode login --https-only --permissions rcl --expiry $end -o tsv`
binarySas=`az storage container generate-sas --name cache --account-name vcpkgbinarycachewus --as-user --auth-mode login --https-only --permissions rclw --expiry $end -o tsv`
echo Minting SAS tokens valid through $end
USER=$(id --user)
docker run --init -i \
-a stderr \
-a stdout \
--user $USER \
--mount type=bind,source=${{ github.workspace }},target=/vcpkg \
--mount type=bind,source=/mnt/vcpkg-ci/failure-logs,target=/vcpkg/failure-logs \
--mount type=bind,source=/mnt/vcpkg-ci,target=/mnt/vcpkg-ci \
--env X_VCPKG_ASSET_SOURCES="x-azurl,https://vcpkgassetcachewus3.blob.core.windows.net/cache,$assetSas,readwrite" \
vcpkgandroidwus.azurecr.io/vcpkg-android:2024-10-21 \
pwsh \
-File /vcpkg/scripts/azure-pipelines/test-modified-ports.ps1 \
-Triplet ${{ matrix.conf.triplet }} \
-BinarySourceStub "x-azblob,https://vcpkgbinarycachewus.blob.core.windows.net/cache,$binarySas" \
-WorkingRoot /mnt/vcpkg-ci
- name: 'Validate version files'
if: ${{ success() && matrix.conf.extra-checks }}
env:
PATH: c:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd;$PATH
run: 'scripts/azure-pipelines/windows/validate-version-files.ps1'
- name: 'Publish Artifact: failure logs for ${{ matrix.conf.triplet }}'
uses: actions/upload-artifact@v4
with:
name: 'failure logs for ${{ matrix.conf.triplet }}'
path: '${{ env.ARTIFACT_STAGING }}/failure-logs'
retention-days: 7
if-no-files-found: ignore
- name: 'Build a file list for all packages'
if: ${{ !cancelled() }}
shell: pwsh
run: |
./vcpkg fetch python3
& $(./vcpkg fetch python3) ./scripts/file_script.py "$env:WORKING_ROOT/installed/vcpkg/info/"
- name: 'Publish Artifact: file lists for ${{ matrix.conf.triplet }}'
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: 'file lists for ${{ matrix.conf.triplet }}'
path: scripts/list_files
retention-days: 7
if-no-files-found: ignore