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