Onboard GitHub Actions as a replacement for Azure DevOps. #27
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Modified Ports | |
on: | |
push: | |
branches: | |
- onboard-actions | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
test-modified-ports: | |
strategy: | |
matrix: | |
triplet: | |
- 'x86-windows' | |
- 'x64-windows' | |
- 'x64-windows-static' | |
- 'x64-windows-static-md' | |
- 'x64-uwp' | |
- 'arm64-windows' | |
- 'arm64-uwp' | |
- 'arm64-osx' | |
- 'x64-osx' | |
- 'x64-linux' | |
- 'arm-neon-android' | |
- 'x64-android' | |
- 'arm64-android' | |
include: | |
- triplet: 'x86-windows' | |
use-windows: true | |
extra-checks: true | |
- triplet: 'x64-windows' | |
use-windows: true | |
- triplet: 'x64-windows-static' | |
use-windows: true | |
- triplet: 'x64-windows-static-md' | |
use-windows: true | |
- triplet: 'x64-uwp' | |
use-windows: true | |
- triplet: 'arm64-windows' | |
use-windows: true | |
- triplet: 'arm64-uwp' | |
use-windows: true | |
- triplet: 'arm64-osx' | |
use-macos: true | |
- triplet: 'x64-osx' | |
use-macos: true | |
- triplet: 'x64-linux' | |
use-linux: true | |
- triplet: 'arm-neon-android' | |
use-android: true | |
- triplet: 'x64-android' | |
use-android: true | |
- triplet: 'arm64-android' | |
use-android: true | |
############################################### | |
- use-windows: true | |
pool: windows | |
onees: vcpkg-windows-wus | |
artifact-staging: "D:\\artifactstaging" | |
vcpkg-downloads: "D:\\downloads" | |
working-root: "D:\\" | |
- use-macos: true | |
pool: macOS | |
onees: vcpkg-windows-wus # FIXME: This should be the macOS pool | |
artifact-staging: /mnt/vcpkg-ci/artifactstaging # FIXME: Are these paths reasonable? | |
vcpkg-downloads: /mnt/vcpkg-ci/downloads | |
working-root: /mnt/vcpkg-ci | |
- use-linux: true | |
pool: linux | |
onees: vcpkg-windows-wus # FIXME: This should be the linux pool | |
artifact-staging: /mnt/vcpkg-ci/artifactstaging | |
working-root: /mnt/vcpkg-ci | |
- use-android: true | |
pool: android | |
onees: vcpkg-windows-wus # FIXME: This should be the android pool | |
artifact-staging: /mnt/vcpkg-ci/artifactstaging | |
working-root: /mnt/vcpkg-ci | |
runs-on: | |
- self-hosted | |
- "1ES.Pool=${{ matrix.onees }}" | |
continue-on-error: true | |
timeout-minutes: 2880 # 2 days | |
env: | |
VCPKG_DOWNLOADS: ${{ matrix.vcpkg-downloads }} | |
WORKING_ROOT: ${{ matrix.working-root }} | |
steps: | |
- name: testing testing testing | |
run: echo "The value of matrix.pool is ${{ matrix.pool }}" | |
- name: Block non-Windows (for testing) | |
if: ${{ success() && !matrix.use-windows }} | |
run: exit 1 | |
- name: Checkout (Windows) | |
uses: actions/checkout@v4 | |
if: ${{ success() && matrix.use-windows }} | |
env: | |
PATH: c:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd;$PATH | |
with: | |
# fetch-depth 50 tries to ensure we capture the whole history of the branch | |
fetch-depth: 50 | |
- name: Checkout (Non-Windows) | |
uses: actions/checkout@v4 | |
if: ${{ success() && !matrix.use-windows }} | |
with: | |
# fetch-depth 50 tries to ensure we capture the whole history of the branch | |
fetch-depth: 50 | |
- name: Azure Login | |
uses: azure/login@v2 | |
with: | |
client-id: a81b4cd3-9d8d-4cb9-9a74-f2038f24f224 | |
subscription-id: 7fcb00fa-a761-49de-8a2f-d67190e62882 | |
tenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 | |
- name: Bootstrap (Windows) | |
if: ${{ success() && matrix.use-windows }} | |
run: ./scripts/bootstrap.ps1 | |
- name: Bootstrap (Non-Windows) | |
if: ${{ success() && !matrix.use-windows }} | |
run: ./scripts/bootstrap.sh | |
- name: Format Manifests | |
if: ${{ success() && matrix.extra-checks }} | |
run: ./vcpkg.exe format-manifest --all | |
- name: Create Format Manifest Diff | |
if: ${{ success() && matrix.extra-checks }} | |
run: ./scripts/azure-pipelines/Create-PRDiff.ps1 -DiffFile "${{ matrix.artifact-staging }}/format.diff" | |
- name: 'Publish Artifact: Format Diff' | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() && !cancelled() && matrix.extra-checks }} | |
with: | |
name: 'format.diff' | |
path: "${{ matrix.artifact-staging }}/format.diff" | |
retention-days: 7 | |
if-no-files-found: error | |
- name: "*** Test Modified Ports" | |
shell: pwsh | |
run: | | |
$current = Get-Date -AsUtc | |
$endDate = $current.AddDays(2) | |
$end = Get-Date -Date $endDate -UFormat '+%Y-%m-%dT%H:%MZ' | |
Write-Host "Getting Asset Cache SAS" | |
$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 | |
if ($LastExitCode -ne 0) { | |
Write-Error "Failed to get Asset Cache SAS" | |
return 1 | |
} | |
$assetSas = $assetSas.Trim() | |
Write-Host "Getting Binary Cache SAS" | |
$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 | |
if ($LastExitCode -ne 0) { | |
Write-Error "Failed to get Binary Cache SAS" | |
return 1 | |
} | |
$binarySas = $binarySas.Trim() | |
$env:X_VCPKG_ASSET_SOURCES = "x-azurl,https://vcpkgassetcachewus3.blob.core.windows.net/cache,$assetSas,readwrite" | |
if ($IsWindows) { # FIXME: Git in the images | |
$env:PATH += ";c:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd" | |
} | |
& scripts/azure-pipelines/test-modified-ports.ps1 -Triplet ${{ matrix.triplet }} -BinarySourceStub "x-azblob,https://vcpkgbinarycachewus.blob.core.windows.net/cache,$binarySas" -WorkingRoot $env:WORKING_ROOT -ArtifactStagingDirectory "${{ matrix.artifact-staging}}" | |
- name: 'Validate version files' | |
run: 'scripts/azure-pipelines/windows/validate-version-files.ps1' | |
- name: 'Publish Artifact: failure logs for ${{ matrix.triplet }}' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: 'failure logs for ${{ matrix.triplet }}' | |
path: '${{ matrix.artifact-staging}}/failure-logs' | |
retention-days: 7 | |
if-no-files-found: ignore | |
- name: 'Build a file list for all packages' | |
if: ${{ !cancelled() }} | |
shell: pwsh | |
run: | | |
& $(./vcpkg fetch python3) ./scripts/file_script.py "${{ matrix.working-root }}/installed/vcpkg/info/" | |
- name: 'Publish Artifact: file lists for ${{ matrix.triplet }}' | |
uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: 'file lists for ${{ matrix.triplet }}' | |
path: scripts/list_files | |
retention-days: 7 | |
if-no-files-found: ignore |