66 region :
77 description : The GKE region
88 default : us-east1
9+ zone :
10+ description : The GKE zone
11+ default : us-east1-b
12+
913 kubernetesVersion :
1014 description : The GKE kubernetes version
1115 default : 1.23
2731 GOOGLE_PROJECT : ${{ secrets.GOOGLE_PROJECT }}
2832 GOOGLE_REGION : ${{ github.event.inputs.region }}
2933
34+ GOOGLE_ZONE : ${{github.event.inputs.zone}}
35+
3036jobs :
3137 acceptance_tests :
38+ permissions :
39+ contents : ' read'
40+ id-token : ' write'
3241 runs-on : ubuntu-latest
3342 steps :
3443 - uses : actions/checkout@v3
4554 uses : " google-github-actions/auth@v0"
4655 with :
4756 credentials_json : ${{ secrets.GOOGLE_CREDENTIALS }}
57+ access_token_lifetime : ' 10800s'
58+
4859 - name : Install Terraform
4960 uses : hashicorp/setup-terraform@v1
5061 with :
@@ -63,11 +74,22 @@ jobs:
6374 env
6475 terraform init
6576 terraform apply -auto-approve
77+ export GOOGLE_CLUSTER_NAME=`terraform output -raw cluster_name`
78+ - name : Get GKE Credentials
79+ env :
80+ KUBECONFIG : ${{ github.workspace }}/kubernetes/test-infra/gke/kubeconfig
81+ uses : ' google-github-actions/get-gke-credentials@v0'
82+ with :
83+ cluster_name : $GOOGLE_CLUSTER_NAME
84+ location : ${{github.event.inputs.zone}}
85+ project_id : ${{ secrets.GOOGLE_PROJECT }}
86+ use_auth_provider : true
87+
6688 - name : Run Acceptance Test Suite
6789 env :
6890 TF_ACC_TERRAFORM_VERSION : ${{ github.event.inputs.terraformVersion }}
6991 TESTARGS : -run '${{ github.event.inputs.runTests }}'
70- KUBE_CONFIG_PATH : ${{ github.workspace }}/kubernetes/test-infra/gke/kubeconfig
92+ KUBE_CONFIG_PATH : $KUBECONFIG
7193 run : |
7294 make testacc
7395 - name : Destroy GKE cluster
0 commit comments