Skip to content

Acceptance Tests (AKS) #405

Acceptance Tests (AKS)

Acceptance Tests (AKS) #405

name: Acceptance Tests (AKS)
on:
workflow_dispatch:
inputs:
location:
description: 'Location'
default: "Canada East"
nodeCount:
description: 'Number of nodes to provision'
default: 2
vmSize:
description: 'The azure machine size for nodes'
default: "Standard_A2_v2"
clusterVersion:
description: 'The version of kubernetes'
default: "1.27"
terraformVersion:
description: Terraform version
default: 1.7.5
runTests:
description: The regex passed to the -run option of `go test`
default: "^TestAcc"
parallelRuns:
description: The maximum number of tests to run simultaneously
default: 8
schedule:
- cron: '0 22 * * *'
env:
KUBE_CONFIG_PATH: ${{ github.workspace }}/kubernetes/test-infra/aks/kubeconfig
TERRAFORM_VERSION: ${{ github.event.inputs.terraformVersion || vars.TERRAFORM_VERSION }}
PARALLEL_RUNS: ${{ github.event.inputs.parallelRuns || vars.PARALLEL_RUNS }}
TF_VAR_location: ${{ github.event.inputs.location || vars.AZURE_LOCATION }}
TF_VAR_node_count: ${{ github.event.inputs.nodeCount || vars.AZURE_NODE_COUNT }}
TF_VAR_vm_size: ${{ github.event.inputs.vmSize || vars.AZURE_VM_SIZE }}
TF_VAR_cluster_version: ${{ github.event.inputs.clusterVersion || vars.CLUSTER_VERSION}}
jobs:
acceptance_tests_aks:
if: ${{ github.repository_owner == 'hashicorp' }}
runs-on: custom-linux-medium
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set up go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 'go.mod'
- name: Install Terraform
uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
terraform_wrapper: false
- name: Azure login
uses: azure/login@8c334a195cbb38e46038007b304988d888bf676a # v2.0.0
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Provision AKS
working-directory: ${{ github.workspace }}/kubernetes/test-infra/aks
run: |
terraform init
terraform apply -auto-approve
- name: Run Tests
env:
TESTARGS: -run ${{ github.event.inputs.runTests || '^TestAcc' }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
run: |
make testacc
- name: Destroy AKS
if: always()
working-directory: ${{ github.workspace }}/kubernetes/test-infra/aks
run: |
terraform destroy -auto-approve