Skip to content

Commit 746d235

Browse files
committed
Use GitHub Actions rather than Azure DevOps except macOS.
This reduces the vcpkg team's compliance burden as we won't be maintaining a separate Azure DevOps instance, and results in a better user experience for contributors as they need not go through so many clicks in order to get build logs. macOS isn't moved over yet because there's value in having all the Azure resources on their own and that's going to be its own can of worms. Also adds arm64-windows-static-md testing as requested by Azure Storage internal customers.
1 parent 813a241 commit 746d235

34 files changed

+181
-402
lines changed

scripts/azure-pipelines/android/create-docker-image.ps1 renamed to .github/workflows/android/create-docker-image.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
$Date = (Get-Date -Format 'yyyy-MM-dd')
44
$ResourceGroupName = "PrAnd-1ES"
5-
$ContainerRegistryName = "vcpkgandroidwus3"
5+
$ContainerRegistryName = "vcpkgandroidwus"
66
$ErrorActionPreference = 'Stop'
77

88
$registry = Get-AzContainerRegistry -ResourceGroupName $ResourceGroupName -Name $ContainerRegistryName

scripts/azure-pipelines/patch-tuesday-checklist.md renamed to .github/workflows/patch-tuesday-checklist.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"C++ VCPKG Validation" about vulnerable software we are installing in the VMs and update that.
1010
(Most often PowerShell needs to be updated)
1111
* [ ] Check for any other software for the Windows images we wish to update and make the edits to do
12-
so in `scripts/azure-pipelines/windows`
12+
so in `.github/windows`
1313
* [ ] Check for any updates possible to `vcpkgTools.xml`. Note that PowerShell currently uses the
1414
7.2.x series due to customer reported problems on older Windows with 7.3.x and later.
1515
* [ ] Update the first line of android/Dockerfile with the current 'focal' image according to
@@ -22,4 +22,4 @@
2222
* [ ] In the Azure portal, mark the newly created image as the 'latest' one.
2323
* [ ] Mint a new macOS base box. (See instructions in `scripts/azure-pipelines/osx/README.md`)
2424
* [ ] Deploy the new base box to all hosts.
25-
* [ ] Update the software on the CTI's machine #12 to match.
25+
* [ ] Update the software on the CTI's machine #1 to match.

.github/workflows/test_modified_ports.yml

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

scripts/azure-pipelines/android/azure-pipelines.yml

-112
This file was deleted.

0 commit comments

Comments
 (0)