Choose TDX supported region for TDX tests

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2024-01-26 15:22:14 +01:00 committed by Malte Poll
parent ecae1c8f9a
commit d17e7459db
2 changed files with 21 additions and 1 deletions

View File

@ -245,6 +245,8 @@ runs:
- name: Pick a random Azure region
id: pick-az-region
uses: ./.github/actions/pick_azure_region
with:
attestationVariant: ${{ inputs.attestationVariant }}
- name: Create IAM configuration
id: constellation-iam-create

View File

@ -1,6 +1,11 @@
name: Pick an Azure region
description: "Pick an Azure region"
inputs:
attestationVariant:
description: "Attestation variant to use. Not all regions support all variants."
required: true
outputs:
region:
description: "One of the supported Azure regions"
@ -13,12 +18,25 @@ runs:
id: pick-region
shell: bash
run: |
possibleRegions=(
possibleRegionsSNP=(
"westus"
"eastus"
"northeurope"
"westeurope"
"southeastasia"
)
possibleRegionsTDX=(
"centralus"
"eastus2"
"northeurope"
"westeurope"
)
if [[ "${{ inputs.attestationVariant }}" == "azure-tdx" ]]; then
possibleRegions=("${possibleRegionsTDX[@]}")
else
possibleRegions=("${possibleRegionsSNP[@]}")
fi
region=${possibleRegions[$RANDOM % ${#possibleRegions[@]}]}
echo "region=$region" | tee -a "$GITHUB_OUTPUT"