-
Notifications
You must be signed in to change notification settings - Fork 18
99 lines (75 loc) · 3.44 KB
/
test_chart.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
name: Lint and Test Charts
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
TAG: v0.0.1
RELEASE_TAG: v0.0.1
MANIFEST_IMG: controller
CONTROLLER_IMG: controller
CONTROLLER_IMAGE_VERSION: v0.0.1
PULL_POLICY: Never
CERT_MANAGER_VERSION: v1.15.2
RANCHER_VERSION: v2.9.0
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.14.3
- uses: actions/setup-python@v5
with:
python-version: '3.9'
check-latest: true
- name: Set up chart-testing
uses: helm/[email protected]
with:
version: v3.9.0
- name: setupGo
uses: actions/[email protected]
with:
go-version: '=1.22.0'
- name: Build docker image
run: make docker-build
- name: Add CAPI operator chart repo
run: helm repo add capi-operator https://kubernetes-sigs.github.io/cluster-api-operator
- name: Package operator chart
run: make release-chart
- name: Run chart-testing (lint)
run: ct lint --validate-maintainers=false --charts out/charts/rancher-turtles/
- name: Create kind cluster
uses: helm/[email protected]
with:
cluster_name: kind
node_image: kindest/node:v1.30.3
- name: Add local docker image
run: kind load docker-image ${{ env.MANIFEST_IMG }}:${{ env.TAG }}
- name: Add cert-manager chart repo
run: helm repo add jetstack https://charts.jetstack.io
- name: Add rancher chart repo
run: helm repo add rancher-latest https://releases.rancher.com/server-charts/latest
- name: Install cert-manager
run: helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version ${{ env.CERT_MANAGER_VERSION }} --set installCRDs=true --wait
- name: Install Rancher
run: helm install rancher rancher-latest/rancher --namespace cattle-system --create-namespace --set bootstrapPassword=rancheradmin --set replicas=1 --set hostname="e2e.dev.rancher" --set 'extraEnv[0].name=CATTLE_FEATURES' --version ${{ env.RANCHER_VERSION }} --wait
- name: Run chart-testing (install)
run: helm install rancher-turtles out/charts/rancher-turtles/ -n rancher-turtles-system --create-namespace --wait --debug
- name: Wait for core provider rollout
run: sleep 30 && kubectl rollout status deployment capi-controller-manager -n capi-system --timeout=180s
- name: Wait for RKE2 bootstrap provider rollout
run: sleep 30 && kubectl rollout status deployment rke2-bootstrap-controller-manager -n rke2-bootstrap-system --timeout=180s
- name: Wait for RKE2 control plane provider rollout
run: sleep 30 && kubectl rollout status deployment rke2-control-plane-controller-manager -n rke2-control-plane-system --timeout=180s
- name: Run chart-testing (un-install)
run: helm uninstall rancher-turtles -n rancher-turtles-system --cascade foreground --wait --debug --timeout=10m
- name: Run chart re-install
run: helm install rancher-turtles out/charts/rancher-turtles/ -n rancher-turtles-system --create-namespace --wait --debug