diff --git a/.github/workflows/create-aks.yaml b/.github/workflows/create-aks.yaml deleted file mode 100644 index cfd08f5cd6..0000000000 --- a/.github/workflows/create-aks.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: CI | Create AKS cluster -on: - workflow_call: - inputs: - name: - required: true - type: string - -jobs: - create-aks: - runs-on: ubuntu-latest - steps: - - name: Download Azure CLI - run: | - curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash - - - name: Log into the Azure account - run: | - az login \ - --service-principal \ - -u "${{ secrets.AZ_APPID }}" \ - -p "${{ secrets.AZ_PASSWORD }}" \ - --tenant "${{ secrets.AZ_TENANT_ID }}" - - - name: Create AKS cluster - run: | - az aks create \ - -g "kataCI" \ - -n "${{ inputs.name }}" \ - -s "Standard_D4s_v5" \ - --node-count 1 \ - --generate-ssh-keys diff --git a/.github/workflows/delete-aks.yaml b/.github/workflows/delete-aks.yaml deleted file mode 100644 index 2c9e6d21a6..0000000000 --- a/.github/workflows/delete-aks.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: CI | Delete AKS cluster -on: - workflow_call: - inputs: - name: - required: true - type: string - -jobs: - delete-aks: - runs-on: ubuntu-latest - steps: - - name: Download Azure CLI - run: | - curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash - - - name: Log into the Azure account - run: | - az login \ - --service-principal \ - -u "${{ secrets.AZ_APPID }}" \ - -p "${{ secrets.AZ_PASSWORD }}" \ - --tenant "${{ secrets.AZ_TENANT_ID }}" - - - name: Delete AKS cluster - run: | - az aks delete \ - -g "kataCI" \ - -n "${{ inputs.name }}" \ - --yes \ - --no-wait diff --git a/.github/workflows/run-k8s-tests-on-aks.yaml b/.github/workflows/run-k8s-tests-on-aks.yaml index 715814818f..96b6a9307b 100644 --- a/.github/workflows/run-k8s-tests-on-aks.yaml +++ b/.github/workflows/run-k8s-tests-on-aks.yaml @@ -23,22 +23,13 @@ jobs: - qemu runs-on: ubuntu-latest steps: - - name: Create AKS cluster to test ${{ matrix.vmm }} - uses: ./.github/workflows-create-aks.yaml - with: - name: ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-${{ matrix.vmm }}-amd64 - - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} - - name: Install `bats` - run: | - sudo apt-get update - sudo apt-get -y install bats - - name: Install `kubectl` + - name: Download Azure CLI run: | - sudo az aks install-cli + curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash - name: Log into the Azure account run: | @@ -48,6 +39,24 @@ jobs: -p "${{ secrets.AZ_PASSWORD }}" \ --tenant "${{ secrets.AZ_TENANT_ID }}" + - name: Create AKS cluster + run: | + az aks create \ + -g "kataCI" \ + -n "${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-${{ matrix.vmm }}-amd64" \ + -s "Standard_D4s_v5" \ + --node-count 1 \ + --generate-ssh-keys + + - name: Install `bats` + run: | + sudo apt-get update + sudo apt-get -y install bats + + - name: Install `kubectl` + run: | + sudo az aks install-cli + - name: Download credentials for the Kubernetes CLI to use them run: | az aks get-credentials -g "kataCI" -n ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-${{ matrix.vmm }}-amd64 @@ -73,8 +82,10 @@ jobs: env: KATA_HYPERVISOR: ${{ matrix.vmm }} - - name: Delete AKS cluster used to test ${{ matrix.vmm }} - if: always() - uses: ./.github/workflows/delete-aks.yaml - with: - name: ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-${{ matrix.vmm }}-amd64 + - name: Delete AKS cluster + run: | + az aks delete \ + -g "kataCI" \ + -n "${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-${{ matrix.vmm }}-amd64" \ + --yes \ + --no-wait