constellation/.github/actions/pick_azure_region/action.yml
Daniel Weiße d17e7459db Choose TDX supported region for TDX tests
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
2024-01-26 17:06:28 +01:00

43 lines
1.0 KiB
YAML

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"
value: ${{ steps.pick-region.outputs.region }}
runs:
using: "composite"
steps:
- name: Pick a region
id: pick-region
shell: bash
run: |
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"