Skip to content

Acceptance Tests (AKS) #21

Acceptance Tests (AKS)

Acceptance Tests (AKS) #21

name: Acceptance Tests (AKS)
on:
workflow_dispatch:
inputs:
location:
description: 'Location'
default: "West Europe"
node_count:
description: 'Number of nodes to provision'
default: 2
vm_size:
description: 'The azure machine size for nodes'
default: "Standard_A4_v2"
clusterVersion:
description: 'The version of kubernetes'
default: "1.27"
terraformVersion:
description: Terraform version
default: 1.5.6
runTests:
description: The regex passed to the -run option of `go test`
default: ".*"
schedule:
- cron: '0 22 * * *'
env:
KUBE_CONFIG_PATH: ${{ github.workspace }}/kubernetes/test-infra/aks/kubeconfig
TERRAFORM_VERSION: ${{ github.event.inputs.terraformVersion || vars.TERRAFORM_VERSION }}
TF_VAR_az_span: ${{ github.event.inputs.azSpan }}
TF_VAR_cluster_version: ${{ github.event.inputs.clusterVersion || vars.CLUSTER_VERSION}}
TF_VAR_nodes_per_az: ${{ github.event.inputs.nodesPerAz }}
TF_VAR_instance_type: ${{ github.event.inputs.instanceType }}
jobs:
acceptanceTests:
runs-on: [custom, linux, medium]
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Set up go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version-file: 'go.mod'
- name: Install Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
- name: Azure login
uses: azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.6
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Provision AKS
working-directory: ${{ github.workspace }}/kubernetes/test-infra/aks-new
run: |
terraform init
terraform apply --auto-approve
- name: Run Tests
env:
TESTARGS: -run '${{ inputs.runTests }}'
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
run: |
make testacc
- name: Destroy AKS
if: always()
working-directory: ./kubernetes/test-infra/aks-new
run: |
terraform destroy --auto-approve