diff --git a/.github/workflows/e2e-windows.yml b/.github/workflows/e2e-windows.yml index 86cf5f6bc..bbccd079e 100644 --- a/.github/workflows/e2e-windows.yml +++ b/.github/workflows/e2e-windows.yml @@ -14,6 +14,11 @@ jobs: build-cli: name: Build Windows CLI runs-on: ubuntu-22.04 + permissions: + id-token: write + checks: write + contents: read + packages: write steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -26,17 +31,26 @@ jobs: useCache: "true" buildBuddyApiKey: ${{ secrets.BUILDBUDDY_ORG_API_KEY }} + - name: Log in to the Container registry + uses: ./.github/actions/container_registry_login + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build CLI uses: ./.github/actions/build_cli with: targetOS: "windows" targetArch: "amd64" enterpriseCLI: true + outputPath: "build/constellation" + push: true - name: Upload CLI artifact uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: - path: "bazel-bin/cli/cli_enterprise_windows_amd64" + path: build/constellation.exe name: "constell-exe" e2e-test: @@ -57,7 +71,6 @@ jobs: - name: Check CLI version shell: pwsh run: | - Move-Item -Path .\cli_enterprise_windows_amd64 -Destination .\constellation.exe .\constellation.exe version Add-Content -Path $env:windir\System32\drivers\etc\hosts -Value "`n127.0.0.1`tlicense.confidential.cloud" -Force @@ -69,8 +82,10 @@ jobs: - name: Create IAM configuration shell: pwsh run: | + $uid = Get-Random -Minimum 1000 -Maximum 9999 + $rgName = "e2e-win-${{ github.run_id }}-${{ github.run_attempt }}-$uid" .\constellation.exe config generate azure - .\constellation.exe iam create azure --region=westus --resourceGroup=e2eWindoewsRG --servicePrincipal=e2eWindoewsSP --update-config --debug -y + .\constellation.exe iam create azure --region=westus --resourceGroup=$rgName-rg --servicePrincipal=$rgName-sp --update-config --debug -y - name: Login to Azure (Cluster service principal) uses: ./.github/actions/login_azure @@ -96,24 +111,31 @@ jobs: Write-Host "Retry ${retryCount}: Checking node status..." $nodesOutput = & kubectl get nodes --kubeconfig "$PWD\constellation-admin.conf" + $status = $? - $lines = $nodesOutput -split "`r?`n" | Select-Object -Skip 1 + $nodesOutput - $allNodesReady = $true + if ($status) { + $lines = $nodesOutput -split "`r?`n" | Select-Object -Skip 1 - foreach ($line in $lines) { - $columns = $line -split '\s+' | Where-Object { $_ -ne '' } + if ($lines.count -eq 4) { + $allNodesReady = $true - $nodeName = $columns[0] - $status = $columns[1] + foreach ($line in $lines) { + $columns = $line -split '\s+' | Where-Object { $_ -ne '' } - if ($status -ne "Ready") { - Write-Host "Node $nodeName is not ready!" - $allNodesReady = $false + $nodeName = $columns[0] + $status = $columns[1] + + if ($status -ne "Ready") { + Write-Host "Node $nodeName is not ready!" + $allNodesReady = $false + } + } } } - if (-not $allNodesReady) { + if (-not $allNodesReady -and $retryCount -lt $maxRetries) { Write-Host "Retrying in $retryIntervalSeconds seconds..." Start-Sleep -Seconds $retryIntervalSeconds }