Skip to content

Commit 739df9e

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.
1 parent 813a241 commit 739df9e

34 files changed

+179
-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

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

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

-112
This file was deleted.

0 commit comments

Comments
 (0)