Skip to content

Commit 6d5b0cb

Browse files
committed
Use GitHub Actions rather than Azure DevOps.
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.
1 parent 7fd612e commit 6d5b0cb

File tree

4 files changed

+170
-9
lines changed

4 files changed

+170
-9
lines changed

.github/workflows/test_modified_ports.yml

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

scripts/azure-pipelines/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/bootstrap.ps1

100644100755
File mode changed.

scripts/bootstrap.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)