-
Notifications
You must be signed in to change notification settings - Fork 166
137 lines (116 loc) · 5.43 KB
/
everest-pr-checks.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
126
127
128
129
130
131
132
133
134
135
136
name: Everest PR checks
on:
pull_request:
paths:
- 'charts/everest/**'
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
.github/
charts/everest
- name: Check docs
run: |
cd charts/everest
make docs-gen
if git diff --quiet; then
echo "Docs are up to date."
else
echo "Docs are out of date. Please run 'make docs-gen' and commit the changes."
exit 1
fi
- name: Check CRDs
run: |
cd charts/everest
make crds-gen
if git diff --quiet; then
echo "CRDs are up to date."
else
echo "CRDs are out of date. Please run 'make crds-gen' and commit the changes."
exit 1
fi
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.15.4
- uses: azure/setup-kubectl@v4
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config .github/ct.yaml)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Add dependent repos
run: |
make -C charts/everest add-repos
- name: Run chart-testing (lint)
run: |
# Ensure common sub-chart is linted and has version increment
ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --chart-dirs=charts/everest/charts --excluded-charts=everest-db-namespace
# Ensure main chart is linted, skip version increment check
ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --check-version-increment=false
# Ensure all sub-charts are linted, skip version increment check
ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --chart-dirs=charts/everest/charts --check-version-increment=false
- name: Create kind cluster
uses: helm/[email protected]
# Only build a kind cluster if there are chart changes to test.
if: steps.list-changed.outputs.changed == 'true'
- name: Build dependencies
run: |
cd charts/everest
make deps
- name: Basic tests
run: |
# Install the chart
helm install everest ./charts/everest \
--create-namespace \
--namespace everest-system \
--set dbNamespace.enabled=true
# Wait for system components
kubectl wait --for=condition=available --timeout=60s deployment/everest-server -n everest-system
kubectl wait --for=condition=available --timeout=60s deployment/everest-operator -n everest-system
kubectl wait --for=condition=available --timeout=60s deployment/kube-state-metrics -n everest-monitoring
kubectl wait --for=condition=available --timeout=60s deployment/vm-operator -n everest-monitoring
# Wait for default DB namespace.
kubectl wait --for=condition=available --timeout=60s deployment/percona-postgresql-operator -n everest
kubectl wait --for=condition=available --timeout=60s deployment/percona-server-mongodb-operator -n everest
kubectl wait --for=condition=available --timeout=60s deployment/percona-xtradb-cluster-operator -n everest
kubectl wait --for=jsonpath='.status.status'=installed dbengine/percona-server-mongodb-operator --timeout=600s -n everest
kubectl wait --for=jsonpath='.status.status'=installed dbengine/percona-xtradb-cluster-operator --timeout=600s -n everest
kubectl wait --for=jsonpath='.status.status'=installed dbengine/percona-postgresql-operator --timeout=600s -n everest
# Provision new DB namespace
helm install everest ./charts/everest/charts/everest-db-namespace \
--namespace everest-db \
--create-namespace \
--set pxc=false
# Wait for new DB namespace.
kubectl wait --for=condition=available --timeout=60s deployment/percona-postgresql-operator -n everest-db
kubectl wait --for=condition=available --timeout=60s deployment/percona-server-mongodb-operator -n everest-db
kubectl wait --for=jsonpath='.status.status'=installed dbengine/percona-server-mongodb-operator --timeout=600s -n everest-db
kubectl wait --for=jsonpath='.status.status'=installed dbengine/percona-postgresql-operator --timeout=600s -n everest-db
# Uninstall everest-db namespace
helm uninstall everest -n everest-db
kubectl delete ns everest-db
kubectl wait --for=delete namespace/everest-db --timeout=120s
# Uninstall everest-system namespace
helm uninstall everest -n everest-system
kubectl delete ns everest-system
kubectl wait --for=delete namespace/everest-system --timeout=120s
- name: Build chart package
run: |
changed=$(ct list-changed --config .github/ct.yaml)
[ $(echo -n "$changed" | grep -c '^') == 1 ] && helm package $changed || echo "skipping package"
- name: Upload helm chart
uses: actions/upload-artifact@v4
with:
path: ./*.tgz
retention-days: 30
if-no-files-found: ignore