2023-06-21 06:05:04 -04:00
|
|
|
name: e2e test windows
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2023-08-21 08:36:28 -04:00
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
scheduled:
|
|
|
|
description: Whether this is a scheduled run.
|
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
required: false
|
2023-06-21 06:05:04 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-cli:
|
|
|
|
name: Build Windows CLI
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-11 07:49:50 -04:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
2023-06-21 06:05:04 -04:00
|
|
|
with:
|
|
|
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
|
|
|
|
2023-10-23 08:39:45 -04:00
|
|
|
- name: Setup bazel
|
|
|
|
uses: ./.github/actions/setup_bazel_nix
|
|
|
|
with:
|
|
|
|
useCache: "true"
|
|
|
|
buildBuddyApiKey: ${{ secrets.BUILDBUDDY_ORG_API_KEY }}
|
|
|
|
|
2023-06-21 06:05:04 -04:00
|
|
|
- name: Build CLI
|
|
|
|
uses: ./.github/actions/build_cli
|
|
|
|
with:
|
|
|
|
targetOS: "windows"
|
|
|
|
targetArch: "amd64"
|
|
|
|
enterpriseCLI: true
|
|
|
|
|
|
|
|
- name: Upload CLI artifact
|
2023-10-11 07:49:50 -04:00
|
|
|
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
|
2023-06-21 06:05:04 -04:00
|
|
|
with:
|
2023-08-21 08:36:28 -04:00
|
|
|
path: "bazel-bin/cli/cli_enterprise_windows_amd64"
|
|
|
|
name: "constell-exe"
|
2023-06-21 06:05:04 -04:00
|
|
|
|
|
|
|
e2e-test:
|
|
|
|
name: E2E Test Windows
|
|
|
|
runs-on: windows-2022
|
|
|
|
needs: build-cli
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-11 07:49:50 -04:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
2023-06-21 06:05:04 -04:00
|
|
|
with:
|
|
|
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
|
|
|
|
|
|
|
- name: Download CLI artifact
|
|
|
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
|
|
|
with:
|
2023-08-21 08:36:28 -04:00
|
|
|
name: "constell-exe"
|
2023-06-21 06:05:04 -04:00
|
|
|
|
|
|
|
- name: Check CLI version
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
2023-08-21 08:36:28 -04:00
|
|
|
Move-Item -Path .\cli_enterprise_windows_amd64 -Destination .\constellation.exe
|
2023-06-21 06:05:04 -04:00
|
|
|
.\constellation.exe version
|
|
|
|
|
|
|
|
- name: Login to Azure (IAM service principal)
|
|
|
|
uses: ./.github/actions/login_azure
|
|
|
|
with:
|
|
|
|
azure_credentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
|
|
|
|
|
|
|
|
- name: Create IAM configuration
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
2023-06-28 08:47:44 -04:00
|
|
|
.\constellation.exe config generate azure
|
|
|
|
.\constellation.exe iam create azure --region=westus --resourceGroup=e2eWindoewsRG --servicePrincipal=e2eWindoewsSP --update-config --debug -y
|
2023-06-21 06:05:04 -04:00
|
|
|
|
|
|
|
- name: Login to Azure (Cluster service principal)
|
|
|
|
uses: ./.github/actions/login_azure
|
|
|
|
with:
|
|
|
|
azure_credentials: ${{ secrets.AZURE_E2E_CLUSTER_CREDENTIALS }}
|
|
|
|
|
|
|
|
- name: Create cluster
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
2023-08-02 04:45:32 -04:00
|
|
|
.\constellation.exe create --debug -y
|
2023-06-21 06:05:04 -04:00
|
|
|
|
|
|
|
- name: Initialize cluster
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
2023-10-26 09:59:13 -04:00
|
|
|
.\constellation.exe apply --debug
|
2023-06-21 06:05:04 -04:00
|
|
|
|
|
|
|
- name: Liveness probe
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
|
|
|
$retryIntervalSeconds = 30
|
|
|
|
$maxRetries = 50
|
|
|
|
|
|
|
|
$retryCount = 0
|
|
|
|
$allNodesReady = $false
|
|
|
|
|
|
|
|
while (-not $allNodesReady -and $retryCount -lt $maxRetries) {
|
|
|
|
${retryCount}++
|
|
|
|
Write-Host "Retry ${retryCount}: Checking node status..."
|
|
|
|
|
|
|
|
$nodesOutput = & kubectl get nodes --kubeconfig "$PWD\constellation-admin.conf"
|
|
|
|
|
|
|
|
$lines = $nodesOutput -split "`r?`n" | Select-Object -Skip 1
|
|
|
|
|
|
|
|
$allNodesReady = $true
|
|
|
|
|
|
|
|
foreach ($line in $lines) {
|
|
|
|
$columns = $line -split '\s+' | Where-Object { $_ -ne '' }
|
|
|
|
|
|
|
|
$nodeName = $columns[0]
|
|
|
|
$status = $columns[1]
|
|
|
|
|
|
|
|
if ($status -ne "Ready") {
|
|
|
|
Write-Host "Node $nodeName is not ready!"
|
|
|
|
$allNodesReady = $false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (-not $allNodesReady) {
|
|
|
|
Write-Host "Retrying in $retryIntervalSeconds seconds..."
|
|
|
|
Start-Sleep -Seconds $retryIntervalSeconds
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($allNodesReady) {
|
|
|
|
Write-Host "All nodes are ready!"
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
Write-Host "Node status check failed after $maxRetries retries."
|
|
|
|
EXIT 1
|
|
|
|
}
|
|
|
|
|
|
|
|
- name: Terminate cluster
|
|
|
|
if: always()
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
|
|
|
.\constellation.exe terminate --debug -y
|
|
|
|
|
|
|
|
- name: Login to Azure (IAM service principal)
|
|
|
|
if: always()
|
|
|
|
uses: ./.github/actions/login_azure
|
|
|
|
with:
|
|
|
|
azure_credentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
|
|
|
|
|
|
|
|
- name: Delete IAM configuration
|
|
|
|
if: always()
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
|
|
|
.\constellation.exe iam destroy --debug -y
|
2023-08-21 08:36:28 -04:00
|
|
|
|
|
|
|
notify-failure:
|
|
|
|
name: Notify about failure
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
needs: e2e-test
|
|
|
|
if: |
|
|
|
|
failure() &&
|
|
|
|
github.ref == 'refs/heads/main' &&
|
|
|
|
inputs.scheduled
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-11 07:49:50 -04:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
2023-08-21 08:36:28 -04:00
|
|
|
with:
|
|
|
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
|
|
|
|
2023-11-08 09:27:40 -05:00
|
|
|
- name: Setup bazel
|
|
|
|
uses: ./.github/actions/setup_bazel_nix
|
|
|
|
with:
|
|
|
|
useCache: "true"
|
|
|
|
buildBuddyApiKey: ${{ secrets.BUILDBUDDY_ORG_API_KEY }}
|
|
|
|
|
2023-08-21 08:36:28 -04:00
|
|
|
- name: Notify about failure
|
|
|
|
continue-on-error: true
|
2023-11-15 02:48:13 -05:00
|
|
|
uses: ./.github/actions/notify_e2e_failure
|
2023-08-21 08:36:28 -04:00
|
|
|
with:
|
|
|
|
projectWriteToken: ${{ secrets.PROJECT_WRITE_TOKEN }}
|
|
|
|
test: Windows E2E Test
|
|
|
|
provider: Azure
|