From d17e7459db601fad8f4a72ffc2b8130776bb78ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wei=C3=9Fe?= Date: Fri, 26 Jan 2024 15:22:14 +0100 Subject: [PATCH] Choose TDX supported region for TDX tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Weiße --- .github/actions/e2e_test/action.yml | 2 ++ .github/actions/pick_azure_region/action.yml | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/actions/e2e_test/action.yml b/.github/actions/e2e_test/action.yml index 56ff18f3c..50666f01e 100644 --- a/.github/actions/e2e_test/action.yml +++ b/.github/actions/e2e_test/action.yml @@ -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 diff --git a/.github/actions/pick_azure_region/action.yml b/.github/actions/pick_azure_region/action.yml index a37ddd671..8fb7bb538 100644 --- a/.github/actions/pick_azure_region/action.yml +++ b/.github/actions/pick_azure_region/action.yml @@ -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"