From 9c1c876830c6419b81c65c48ef62485a4e77cfea Mon Sep 17 00:00:00 2001 From: Adrian Stobbe Date: Fri, 20 Oct 2023 13:38:08 +0200 Subject: [PATCH] pick random azure region (#2483) --- .github/actions/e2e_test/action.yml | 6 ++++- .github/actions/pick_assignee/action.yml | 2 +- .github/actions/pick_azure_region/action.yml | 24 ++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .github/actions/pick_azure_region/action.yml diff --git a/.github/actions/e2e_test/action.yml b/.github/actions/e2e_test/action.yml index 4931ea561..1bdcbad2f 100644 --- a/.github/actions/e2e_test/action.yml +++ b/.github/actions/e2e_test/action.yml @@ -204,6 +204,10 @@ runs: echo "uuid=${uuid}" | tee -a $GITHUB_OUTPUT echo "prefix=e2e-${{ github.run_id }}-${{ github.run_attempt }}-${uuid}" | tee -a $GITHUB_OUTPUT + - name: Pick a random Azure region + id: pick-az-region + uses: ./.github/actions/pick_azure_region + - name: Create IAM configuration id: constellation-iam-create uses: ./.github/actions/constellation_iam_create @@ -211,7 +215,7 @@ runs: cloudProvider: ${{ inputs.cloudProvider }} namePrefix: ${{ steps.create-prefix.outputs.prefix }} awsZone: ${{ inputs.regionZone || 'us-east-2c' }} - azureRegion: ${{ inputs.regionZone || 'northeurope' }} + azureRegion: ${{ inputs.regionZone || steps.pick-az-region.outputs.region }} gcpProjectID: ${{ inputs.gcpProject }} gcpZone: ${{ inputs.regionZone || 'europe-west3-b' }} kubernetesVersion: ${{ inputs.kubernetesVersion }} diff --git a/.github/actions/pick_assignee/action.yml b/.github/actions/pick_assignee/action.yml index ab8eeacee..5a059e829 100644 --- a/.github/actions/pick_assignee/action.yml +++ b/.github/actions/pick_assignee/action.yml @@ -1,4 +1,4 @@ -name: Pick and assignee +name: Pick an assignee description: "Pick an assignee" outputs: diff --git a/.github/actions/pick_azure_region/action.yml b/.github/actions/pick_azure_region/action.yml new file mode 100644 index 000000000..a37ddd671 --- /dev/null +++ b/.github/actions/pick_azure_region/action.yml @@ -0,0 +1,24 @@ +name: Pick an Azure region +description: "Pick an Azure region" + +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: | + possibleRegions=( + "westus" + "eastus" + "northeurope" + "westeurope" + "southeastasia" + ) + region=${possibleRegions[$RANDOM % ${#possibleRegions[@]}]} + echo "region=$region" | tee -a "$GITHUB_OUTPUT"