Skip to content

Commit

Permalink
Choose TDX supported region for TDX tests
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Weiße <[email protected]>
  • Loading branch information
daniel-weisse committed Jan 26, 2024
1 parent 59d12ff commit 3221648
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/actions/e2e_test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 19 additions & 1 deletion .github/actions/pick_azure_region/action.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"

0 comments on commit 3221648

Please sign in to comment.