Skip to content

Commit 21641c0

Browse files
committed
Onboard GitHub Actions as a replacement for 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 21641c0

File tree

1 file changed

+117
-8
lines changed

1 file changed

+117
-8
lines changed

.github/workflows/test_modified_ports.yml

+117-8
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,130 @@ on:
33
push:
44
branches:
55
- onboard-actions
6+
permissions:
7+
id-token: write
8+
contents: read
69
jobs:
7-
Windows:
10+
test-modified-ports:
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
829
runs-on:
930
- self-hosted
10-
- "1ES.Pool=vcpkg-windows-wus"
31+
- "1ES.Pool=${{ matrix.conf.pool == 'windows' && 'vcpkg-windows-wus' || 'vcpkg-linux-wus' }}"
32+
continue-on-error: true
33+
timeout-minutes: 2880 # 2 days
34+
env:
35+
VCPKG_DOWNLOADS: ${{ matrix.conf.pool == 'windows' && 'D:\downloads' || '/mnt/vcpkg-ci/downloads' }}
36+
WORKING_ROOT: ${{ matrix.conf.pool == 'windows' && 'D:\' || '/mnt/vcpkg-ci' }}
37+
ARTIFACT_STAGING: ${{ matrix.conf.pool == 'windows' && 'D:\artifactstaging' || '/mnt/vcpkg-ci/artifactstaging' }}
1138
steps:
12-
- name: Checkout
39+
- name: Checkout (Windows)
1340
uses: actions/checkout@v4
41+
if: ${{ success() && matrix.conf.pool == 'windows' }}
42+
env:
43+
PATH: c:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd;$PATH
1444
with:
1545
# fetch-depth 50 tries to ensure we capture the whole history of the branch
1646
fetch-depth: 50
47+
- name: Checkout (Non-Windows)
48+
uses: actions/checkout@v4
49+
if: ${{ success() && matrix.conf.pool != 'windows' }}
50+
with:
51+
# fetch-depth 50 tries to ensure we capture the whole history of the branch
52+
fetch-depth: 50
53+
- name: Azure Login
54+
uses: azure/login@v2
55+
with:
56+
client-id: a81b4cd3-9d8d-4cb9-9a74-f2038f24f224
57+
subscription-id: 7fcb00fa-a761-49de-8a2f-d67190e62882
58+
tenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
59+
- name: Bootstrap (Windows)
60+
if: ${{ success() && matrix.conf.pool == 'windows' }}
61+
run: ./scripts/bootstrap.ps1
62+
- name: Bootstrap (Non-Windows)
63+
if: ${{ success() && matrix.conf.pool != 'windows' }}
64+
run: ./scripts/bootstrap.sh
65+
- name: Format Manifests
66+
if: ${{ success() && matrix.conf.extra-checks }}
67+
run: ./vcpkg.exe format-manifest --all
68+
- name: Create Artifact Staging Directory
69+
run: mkdir ${{ env.ARTIFACT_STAGING }}
70+
- name: Create Format Manifest Diff
71+
if: ${{ success() && matrix.conf.extra-checks }}
72+
env:
73+
PATH: c:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd;$PATH
74+
run: ./scripts/azure-pipelines/Create-PRDiff.ps1 -DiffFile "${{ env.ARTIFACT_STAGING }}/format.diff"
75+
- name: 'Publish Artifact: Format Diff'
76+
uses: actions/upload-artifact@v4
77+
if: ${{ failure() && !cancelled() && matrix.conf.extra-checks }}
78+
with:
79+
name: 'format.diff'
80+
path: "${{ env.ARTIFACT_STAGING }}/format.diff"
81+
retention-days: 7
82+
if-no-files-found: error
83+
- name: "*** Test Modified Ports"
84+
shell: pwsh
85+
run: |
86+
$current = Get-Date -AsUtc
87+
$endDate = $current.AddDays(2)
88+
$end = Get-Date -Date $endDate -UFormat '+%Y-%m-%dT%H:%MZ'
89+
Write-Host "Getting Asset Cache SAS"
90+
$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
91+
if ($LastExitCode -ne 0) {
92+
Write-Error "Failed to get Asset Cache SAS"
93+
return 1
94+
}
95+
96+
$assetSas = $assetSas.Trim()
97+
Write-Host "Getting Binary Cache SAS"
98+
$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
99+
if ($LastExitCode -ne 0) {
100+
Write-Error "Failed to get Binary Cache SAS"
101+
return 1
102+
}
103+
104+
$binarySas = $binarySas.Trim()
105+
$env:X_VCPKG_ASSET_SOURCES = "x-azurl,https://vcpkgassetcachewus3.blob.core.windows.net/cache,$assetSas,readwrite"
106+
if ($IsWindows) { # FIXME: Git in the images
107+
$env:PATH += ";c:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd"
108+
}
17109
18-
- name: Bootstrap
19-
run: ./bootstrap-vcpkg.sh
20-
21-
- name: Example
110+
& 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
111+
- name: 'Validate version files'
112+
run: 'scripts/azure-pipelines/windows/validate-version-files.ps1'
113+
- name: 'Publish Artifact: failure logs for ${{ matrix.conf.triplet }}'
114+
uses: actions/upload-artifact@v4
115+
with:
116+
name: 'failure logs for ${{ matrix.conf.triplet }}'
117+
path: '${{ env.ARTIFACT_STAGING }}/failure-logs'
118+
retention-days: 7
119+
if-no-files-found: ignore
120+
- name: 'Build a file list for all packages'
121+
if: ${{ !cancelled() }}
22122
shell: pwsh
23-
run: Write-Host 'Running on 1ES Hosted GitHub Runners'
123+
run: |
124+
& $(./vcpkg fetch python3) ./scripts/file_script.py "${{ matrix.working-root }}/installed/vcpkg/info/"
125+
- name: 'Publish Artifact: file lists for ${{ matrix.conf.triplet }}'
126+
uses: actions/upload-artifact@v4
127+
if: ${{ !cancelled() }}
128+
with:
129+
name: 'file lists for ${{ matrix.conf.triplet }}'
130+
path: scripts/list_files
131+
retention-days: 7
132+
if-no-files-found: ignore

0 commit comments

Comments
 (0)