From 7336155452d2f1e4f4e0f192f3e3dc4bc831ad74 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Thu, 4 Jan 2024 13:31:20 -0600 Subject: [PATCH] Fixing kubeconfig issue in test.yaml (#918) --- .github/workflows/test.yaml | 56 ++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 42d5714c..7e8607ca 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -136,6 +136,34 @@ jobs: --username ${{ secrets.AZURE_SP_TESTS_APPID }} \ --password ${{ secrets.AZURE_SP_TESTS_PASSWORD }} \ --tenant ${{ secrets.AZURE_SP_TESTS_TENANTID }} + - name: Configure AWS + if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.credential == 'aws' + run: | + aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} + aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws configure set region ${{ env.AWS_REGION }} + aws configure set output json + - name: Download k3d + if: steps.gen-id.outputs.RUN_TEST == 'true' + run: wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash + - name: Create k3d cluster + if: steps.gen-id.outputs.RUN_TEST == 'true' + run: k3d cluster create --agents 2 -p "80:80@loadbalancer" --k3s-arg "--disable=traefik@server:0" --registry-create sampleregistry:51351 + - name: Build images + if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.images != '' + run: | + # split images and directories into arrays + IFS=',' read -ra images <<< "${{ matrix.images }}" + IFS=',' read -ra directories <<< "${{ matrix.directories }}" + echo "Building images: $images" + echo "Directories: $directories" + for index in "${!images[@]}"; do + image=${images[$index]} + directory=${directories[$index]} + echo "Building image $image from directory $directory" + docker build -t localhost:51351/$image:latest $directory + docker push localhost:51351/$image:latest + done # Create and install test environment - name: Create Azure resource group if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.credential == 'azure' @@ -151,13 +179,6 @@ jobs: echo "Waiting for resource group ${{ steps.gen-id.outputs.TEST_AZURE_RESOURCE_GROUP }} to be created..." sleep 5 done - - name: Configure AWS - if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.credential == 'aws' - run: | - aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} - aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws configure set region ${{ env.AWS_REGION }} - aws configure set output json - name: Create EKS Cluster if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.credential == 'aws' id: create-eks @@ -177,27 +198,6 @@ jobs: aws eks update-kubeconfig --region ${{ env.AWS_REGION }} --name ${{ steps.gen-id.outputs.TEST_EKS_CLUSTER_NAME }} timeout-minutes: 60 continue-on-error: false - - name: Download k3d - if: steps.gen-id.outputs.RUN_TEST == 'true' - run: wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash - - name: Create k3d cluster - if: steps.gen-id.outputs.RUN_TEST == 'true' - run: k3d cluster create --agents 2 -p "80:80@loadbalancer" --k3s-arg "--disable=traefik@server:0" --registry-create sampleregistry:51351 - - name: Build images - if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.images != '' - run: | - # split images and directories into arrays - IFS=',' read -ra images <<< "${{ matrix.images }}" - IFS=',' read -ra directories <<< "${{ matrix.directories }}" - echo "Building images: $images" - echo "Directories: $directories" - for index in "${!images[@]}"; do - image=${images[$index]} - directory=${directories[$index]} - echo "Building image $image from directory $directory" - docker build -t localhost:51351/$image:latest $directory - docker push localhost:51351/$image:latest - done - name: Install Dapr if: steps.gen-id.outputs.RUN_TEST == 'true' && steps.gen-id.outputs.ENABLE_DAPR == 'true' run: |