EVEREST-107 | Update flag names in everest-db-namespace chart #47
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 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: 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-core ./charts/everest --create-namespace --namespace everest-system | |
# Wait for system components | |
kubectl wait --for=condition=available --timeout=60s deployment/percona-everest -n everest-system | |
kubectl wait --for=condition=available --timeout=60s deployment/everest-operator -n everest-system | |
# Provision DB namespace | |
kubectl create ns everest | |
kubectl label ns everest app.kubernetes.io/managed-by=everest | |
helm install everest ./charts/everest/charts/everest-db-namespace --namespace everest | |
# Ensure operators are installed | |
subs=$(kubectl -n everest get subscription -o jsonpath='{.items[*].metadata.name}') | |
for sub in $subs | |
do | |
echo "Waiting for InstallPlan to be created for Subscription $sub" | |
kubectl wait --for=jsonpath='.status.installplan.name' sub/$sub -n everest --timeout=600s | |
ip=$(kubectl -n everest get sub $sub -o jsonpath='{.status.installplan.name}') | |
echo "InstallPlan $ip created for Subscription $sub" | |
echo "Waiting for InstallPlan to be complete $ip" | |
kubectl wait --for=jsonpath='.status.phase'=Complete installplan/$ip -n everest --timeout=600s | |
csv=$(kubectl get sub $sub -n everest -o jsonpath='{.status.installedCSV}') | |
echo "Waiting for CSV $csv to succeed" | |
kubectl wait --for=jsonpath='.status.phase'=Succeeded csv/$csv -n everest --timeout=600s | |
done | |
# Check DB engines | |
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 | |
# Uninstall | |
helm uninstall everest -n everest | |
kubectl delete ns everest | |
kubectl wait --for=delete namespace/everest --timeout=120s | |
helm uninstall everest-core -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 | |