-
Notifications
You must be signed in to change notification settings - Fork 976
68 lines (65 loc) · 2.26 KB
/
acceptance_tests_aks.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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