This repository has been archived by the owner on Jun 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
125 lines (110 loc) · 4.26 KB
/
terratest.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Terratest
on:
push:
tags:
- v*
branches:
- main
pull_request:
jobs:
terratest:
name: terratest
runs-on: ubuntu-latest
strategy:
matrix:
test-file: [
"annotation_test.go",
"ep_lifecycle_test.go",
"fo_lifecycle_2_clusters_test.go",
"fo_lifecycle_3_clusters_test.go",
"fo_lifecycle_3_clusters_ordered_test.go",
"rr_lifecycle_test.go",
"wrr_lifecycle_test.go"
]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install Clusters
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f
with:
go-version: 1.19.1
- name: Create edgeDNS k3s Cluster
uses: AbsaOSS/k3d-action@b176c2a6dcae72e3e64e3e4d61751904ec314002
with:
cluster-name: "edge-dns"
args: -c terratest/deploy/k3d/edge-dns.yaml
- name: Create EU k3s Cluster
uses: AbsaOSS/k3d-action@b176c2a6dcae72e3e64e3e4d61751904ec314002
with:
cluster-name: "k8gb-test-eu"
args: -c terratest/deploy/k3d/k8gb-test-eu.yaml
- name: Create US k3s Cluster
uses: AbsaOSS/k3d-action@b176c2a6dcae72e3e64e3e4d61751904ec314002
with:
cluster-name: "k8gb-test-us"
args: -c terratest/deploy/k3d/k8gb-test-us.yaml
- name: Create ZA k3s Cluster
uses: AbsaOSS/k3d-action@b176c2a6dcae72e3e64e3e4d61751904ec314002
with:
cluster-name: "k8gb-test-za"
args: -c terratest/deploy/k3d/k8gb-test-za.yaml
- name: K8GB deployment
run: |
make deploy-full-terratest-setup
echo "Cluster EU:"
kubectl get no -owide --context=k3d-k8gb-test-eu
echo "Cluster US:"
kubectl get no -owide --context=k3d-k8gb-test-us
echo "Cluster ZA:"
kubectl get no -owide --context=k3d-k8gb-test-za
- name: Running Terratests
run: |
cd terratest
go mod tidy && go test test/${{ matrix.test-file }} -v -timeout 60m
terratest-kube-version:
needs: terratest
name: terratest-kube-version
runs-on: ubuntu-latest
strategy:
matrix:
kubernetes-version: ["k3s:v1.20.7-k3s1","k3s:v1.20.15-k3s1", "k3s:v1.21.14-k3s1", "k3s:v1.22.17-k3s1", "k3s:v1.23.15-k3s1", "k3s:v1.24.9-k3s1","k3s:v1.25.5-rc1-k3s2","k3s:v1.26.0-rc1-k3s2"]
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install Clusters
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f
with:
go-version: 1.19.1
- name: Create edgeDNS k3s Cluster
uses: AbsaOSS/k3d-action@b176c2a6dcae72e3e64e3e4d61751904ec314002
with:
cluster-name: "edge-dns"
args: -c terratest/deploy/k3d/edge-dns.yaml
- name: Create EU k3s Cluster on Kubernetes ${{ matrix.kubernetes-version }}
uses: AbsaOSS/k3d-action@b176c2a6dcae72e3e64e3e4d61751904ec314002
with:
cluster-name: "k8gb-test-eu"
args: -c terratest/deploy/k3d/k8gb-test-eu.yaml --image=docker.io/rancher/${{ matrix.kubernetes-version }}
- name: Create US k3s Cluster on Kubernetes ${{ matrix.kubernetes-version }}
uses: AbsaOSS/k3d-action@b176c2a6dcae72e3e64e3e4d61751904ec314002
with:
cluster-name: "k8gb-test-us"
args: -c terratest/deploy/k3d/k8gb-test-us.yaml --image=docker.io/rancher/${{ matrix.kubernetes-version }}
- name: Create ZA k3s Cluster on Kubernetes ${{ matrix.kubernetes-version }}
uses: AbsaOSS/k3d-action@b176c2a6dcae72e3e64e3e4d61751904ec314002
with:
cluster-name: "k8gb-test-za"
args: -c terratest/deploy/k3d/k8gb-test-za.yaml --image=docker.io/rancher/${{ matrix.kubernetes-version }}
- name: K8GB deployment
run: |
make deploy-full-terratest-setup
echo "Cluster EU:"
kubectl get no -owide --context=k3d-k8gb-test-eu
echo "Cluster US:"
kubectl get no -owide --context=k3d-k8gb-test-us
echo "Cluster ZA:"
kubectl get no -owide --context=k3d-k8gb-test-za
- name: Running Terratests against 1 cluster
run: |
cd terratest
go mod tidy && go test test/ep_lifecycle_test.go -v -timeout 60m