Skip to content

K8SPSMDB-1498 Release psmdb 1.22.0 #2339

K8SPSMDB-1498 Release psmdb 1.22.0

K8SPSMDB-1498 Release psmdb 1.22.0 #2339

Workflow file for this run

name: Lint and Test Charts
on:
pull_request:
path-ignore:
- 'charts/gcp-marketplace/**'
- 'charts/everest/**'
- 'charts/pmm-ha/**'
- 'charts/pmm-ha-dependencies/**'
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4.3.1
with:
version: v3.20.0
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
- 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: ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml --excluded-charts=everest,pmm-ha,pmm-ha-dependencies
- name: Create kind cluster
uses: helm/kind-action@v1.10.0
# Only build a kind cluster if there are chart changes to test.
if: steps.list-changed.outputs.changed == 'true'
- name: Run db-chart-testing (install)
run: |
echo "Base branch is $GITHUB_BASE_REF"
excluded_charts=("everest")
OPERATOR_INSTALL=$(ct list-changed --config .github/ct.yaml | sed -E 's:charts/::' | awk '/(-db|-operator)$/ { sub(/-db$/, "-operator"); print }' | sort -u)
if [ -n "$OPERATOR_INSTALL" ]; then
for operator in $OPERATOR_INSTALL; do
HELM_ARGS=()
if [[ "$GITHUB_BASE_REF" == release-* ]]; then
IMAGE_NAME=$(yq e '.operatorImageRepository // .image.repository' "charts/$operator/values.yaml" | awk -F/ '{print $NF}')
HELM_ARGS=(
--set "image.repository=perconalab/$IMAGE_NAME"
--set "image.tag=main"
--set "operatorImageRepository=perconalab/$IMAGE_NAME"
--set "image=perconalab/$IMAGE_NAME:main"
)
echo "${HELM_ARGS[@]}"
fi
helm install --namespace default $operator charts/$operator/. --wait --debug "${HELM_ARGS[@]}"
excluded_charts+=($operator)
done
fi
ct install --config .github/ct.yaml --excluded-charts=$(IFS=,; echo "${excluded_charts[*]}")
if [ -n "$OPERATOR_INSTALL" ]; then
for operator in $OPERATOR_INSTALL; do helm uninstall --namespace default $operator; done
fi
- name: Run crd-chart-testing (install)
run: |
CRD_INSTALL=$(ct list-changed --config .github/ct.yaml | sed 's:^charts/::' | grep '\-operator-crds$')
if [ -n "$CRD_INSTALL" ]; then
for crd in $CRD_INSTALL; do
helm install --namespace default $crd charts/$crd/. --take-ownership
helm uninstall --namespace default $crd
done
fi
- 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