forked from virtual-kubelet/azure-aci
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 2.37 KB
/
aks-addon-tests.yml
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
69
70
71
72
73
74
75
76
77
78
name: aks-addon-e2e-tests
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
pull_request_target:
branches: [master]
paths-ignore: ['docs/**', '**.md', '**.mdx', '**.png', '**.jpg']
push:
branches: [master]
paths-ignore: ['docs/**', '**.md', '**.mdx', '**.png', '**.jpg']
env:
REGISTRY: ghcr.io
GO_VERSION: '1.20' # Common versions
E2E_IMG_TAG: 'e2e-ci'
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
actions: read #This is required for reading environment variables
deployments: read #This is required for reading deployment status
jobs:
aks-addon-e2e-tests:
environment: test
runs-on: ubuntu-latest
steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Get Repo
run: |
echo "REGISTRY=$(echo "${{ env.REGISTRY }}/${{ github.repository }}" | tr [:upper:] [:lower:])" >> $GITHUB_ENV
- name: Set e2e Cluster Name
run: |
echo "pr_sha_short=$(git rev-parse --short ${{ github.event.pull_request.head.sha }} )" >> $GITHUB_ENV
rand=${{ env.pr_sha_short }}
if [ "$rand" = "" ]; then
rand=$RANDOM
fi
echo "CLUSTER_NAME=aks-addon-vk-test${rand}" >> $GITHUB_ENV
- uses: azure/login@v2.1.1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Run e2e test
run: |
OUTPUT_TYPE=type=registry make aks-addon-e2e-test
env:
REGISTRY: ${{ env.REGISTRY}}
E2E_REGION: ${{ secrets.E2E_REGION}}
CLUSTER_NAME: ${{ env.CLUSTER_NAME }}
VERSION: ${{ env.E2E_IMG_TAG}}
E2E_TARGET: "pr"
PR_COMMIT_SHA: ${{ env.pr_sha_short }}
- name: Cleanup e2e resources
if: ${{ always() }}
run: |
set +e
az group delete --name "${{ env.CLUSTER_NAME }}" --yes --no-wait || true