Skip to content

Commit 2c4347a

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 2c4347a

File tree

1 file changed

+166
-8
lines changed

1 file changed

+166
-8
lines changed

.github/workflows/test_modified_ports.yml

+166-8
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,179 @@ 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+
triplet:
14+
- 'x86-windows'
15+
- 'x64-windows'
16+
- 'x64-windows-static'
17+
- 'x64-windows-static-md'
18+
- 'x64-uwp'
19+
- 'arm64-windows'
20+
- 'arm64-uwp'
21+
# - 'arm64-osx'
22+
# - 'x64-osx'
23+
# - 'x64-linux'
24+
# - 'arm-neon-android'
25+
# - 'x64-android'
26+
# - 'arm64-android'
27+
include:
28+
- triplet: 'x86-windows'
29+
use-windows: true
30+
extra-checks: true
31+
- triplet: 'x64-windows'
32+
use-windows: true
33+
- triplet: 'x64-windows-static'
34+
use-windows: true
35+
- triplet: 'x64-windows-static-md'
36+
use-windows: true
37+
- triplet: 'x64-uwp'
38+
use-windows: true
39+
- triplet: 'arm64-windows'
40+
use-windows: true
41+
- triplet: 'arm64-uwp'
42+
use-windows: true
43+
# - triplet: 'arm64-osx'
44+
# use-macos: true
45+
# - triplet: 'x64-osx'
46+
# use-macos: true
47+
# - triplet: 'x64-linux'
48+
# use-linux: true
49+
# - triplet: 'arm-neon-android'
50+
# use-android: true
51+
# - triplet: 'x64-android'
52+
# use-android: true
53+
# - triplet: 'arm64-android'
54+
# use-android: true
55+
###############################################
56+
- use-windows: true
57+
pool: windows
58+
onees: vcpkg-windows-wus
59+
artifact-staging: "D:\\artifactstaging"
60+
vcpkg-downloads: "D:\\downloads"
61+
working-root: "D:\\"
62+
# - use-macos: true
63+
# pool: macOS
64+
# onees: vcpkg-windows-wus # FIXME: This should be the macOS pool
65+
# artifact-staging: /mnt/vcpkg-ci/artifactstaging # FIXME: Are these paths reasonable?
66+
# vcpkg-downloads: /mnt/vcpkg-ci/downloads
67+
# working-root: /mnt/vcpkg-ci
68+
# - use-linux: true
69+
# pool: linux
70+
# onees: vcpkg-windows-wus # FIXME: This should be the linux pool
71+
# artifact-staging: /mnt/vcpkg-ci/artifactstaging
72+
# working-root: /mnt/vcpkg-ci
73+
# - use-android: true
74+
# pool: android
75+
# onees: vcpkg-windows-wus # FIXME: This should be the android pool
76+
# artifact-staging: /mnt/vcpkg-ci/artifactstaging
77+
# working-root: /mnt/vcpkg-ci
878
runs-on:
979
- self-hosted
10-
- "1ES.Pool=vcpkg-windows-wus"
80+
- "1ES.Pool=${{ matrix.onees }}"
81+
continue-on-error: true
82+
timeout-minutes: 2880 # 2 days
83+
env:
84+
VCPKG_DOWNLOADS: ${{ matrix.vcpkg-downloads }}
85+
WORKING_ROOT: ${{ matrix.working-root }}
1186
steps:
12-
- name: Checkout
87+
- name: testing testing testing
88+
run: echo "The value of matrix.pool is ${{ matrix.pool }}"
89+
- name: Block non-Windows (for testing)
90+
if: ${{ success() && !matrix.use-windows }}
91+
run: exit 1
92+
- name: Checkout (Windows)
1393
uses: actions/checkout@v4
94+
if: ${{ success() && matrix.use-windows }}
95+
env:
96+
PATH: c:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd;$PATH
1497
with:
1598
# fetch-depth 50 tries to ensure we capture the whole history of the branch
1699
fetch-depth: 50
100+
- name: Checkout (Non-Windows)
101+
uses: actions/checkout@v4
102+
if: ${{ success() && !matrix.use-windows }}
103+
with:
104+
# fetch-depth 50 tries to ensure we capture the whole history of the branch
105+
fetch-depth: 50
106+
- name: Azure Login
107+
uses: azure/login@v2
108+
with:
109+
client-id: a81b4cd3-9d8d-4cb9-9a74-f2038f24f224
110+
subscription-id: 7fcb00fa-a761-49de-8a2f-d67190e62882
111+
tenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
112+
- name: Bootstrap (Windows)
113+
if: ${{ success() && matrix.use-windows }}
114+
run: ./scripts/bootstrap.ps1
115+
- name: Bootstrap (Non-Windows)
116+
if: ${{ success() && !matrix.use-windows }}
117+
run: ./scripts/bootstrap.sh
118+
- name: Format Manifests
119+
if: ${{ success() && matrix.extra-checks }}
120+
run: ./vcpkg.exe format-manifest --all
121+
- name: Create Format Manifest Diff
122+
if: ${{ success() && matrix.extra-checks }}
123+
run: ./scripts/azure-pipelines/Create-PRDiff.ps1 -DiffFile "${{ matrix.artifact-staging }}/format.diff"
124+
- name: 'Publish Artifact: Format Diff'
125+
uses: actions/upload-artifact@v4
126+
if: ${{ failure() && !cancelled() && matrix.extra-checks }}
127+
with:
128+
name: 'format.diff'
129+
path: "${{ matrix.artifact-staging }}/format.diff"
130+
retention-days: 7
131+
if-no-files-found: error
132+
- name: "*** Test Modified Ports"
133+
shell: pwsh
134+
run: |
135+
$current = Get-Date -AsUtc
136+
$endDate = $current.AddDays(2)
137+
$end = Get-Date -Date $endDate -UFormat '+%Y-%m-%dT%H:%MZ'
138+
Write-Host "Getting Asset Cache SAS"
139+
$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
140+
if ($LastExitCode -ne 0) {
141+
Write-Error "Failed to get Asset Cache SAS"
142+
return 1
143+
}
144+
145+
$assetSas = $assetSas.Trim()
146+
Write-Host "Getting Binary Cache SAS"
147+
$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
148+
if ($LastExitCode -ne 0) {
149+
Write-Error "Failed to get Binary Cache SAS"
150+
return 1
151+
}
152+
153+
$binarySas = $binarySas.Trim()
154+
$env:X_VCPKG_ASSET_SOURCES = "x-azurl,https://vcpkgassetcachewus3.blob.core.windows.net/cache,$assetSas,readwrite"
155+
if ($IsWindows) { # FIXME: Git in the images
156+
$env:PATH += ";c:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd"
157+
}
17158
18-
- name: Bootstrap
19-
run: ./bootstrap-vcpkg.sh
20-
21-
- name: Example
159+
& scripts/azure-pipelines/test-modified-ports.ps1 -Triplet ${{ matrix.triplet }} -BinarySourceStub "x-azblob,https://vcpkgbinarycachewus.blob.core.windows.net/cache,$binarySas" -BuildReason PullRequest -WorkingRoot $env:WORKING_ROOT -ArtifactStagingDirectory "${{ matrix.artifact-staging}}"
160+
- name: 'Validate version files'
161+
run: 'scripts/azure-pipelines/windows/validate-version-files.ps1'
162+
- name: 'Publish Artifact: failure logs for ${{ matrix.triplet }}'
163+
uses: actions/upload-artifact@v4
164+
with:
165+
name: 'failure logs for ${{ matrix.triplet }}'
166+
path: '${{ matrix.artifact-staging}}/failure-logs'
167+
retention-days: 7
168+
if-no-files-found: ignore
169+
- name: 'Build a file list for all packages'
170+
if: ${{ !cancelled() }}
22171
shell: pwsh
23-
run: Write-Host 'Running on 1ES Hosted GitHub Runners'
172+
run: |
173+
& $(./vcpkg fetch python3) ./scripts/file_script.py "${{ matrix.working-root }}/installed/vcpkg/info/"
174+
- name: 'Publish Artifact: file lists for ${{ matrix.triplet }}'
175+
uses: actions/upload-artifact@v4
176+
if: ${{ !cancelled() }}
177+
with:
178+
name: 'file lists for ${{ matrix.triplet }}'
179+
path: scripts/list_files
180+
retention-days: 7
181+
if-no-files-found: ignore

0 commit comments

Comments
 (0)