K8SPSMDB-1470: revert dependency between crds and operator charts #2341
Workflow file for this run
This file contains hidden or 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: Lint and Test Charts | |
| on: | |
| pull_request: | |
| path-ignore: | |
| - 'charts/gcp-marketplace/**' | |
| - 'charts/everest/**' | |
| 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.2.0 | |
| with: | |
| version: v3.15.4 | |
| - 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 | |
| - 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: | | |
| OPERATOR_INSTALL=$(ct list-changed --config .github/ct.yaml | sed 's:charts/::' | grep "\-db$" | sed 's/-db$/-operator/') | |
| if [ -n "$OPERATOR_INSTALL" ]; then | |
| for operator in $OPERATOR_INSTALL; do helm install --namespace default $operator charts/$operator/.; done | |
| fi | |
| ct install --config .github/ct.yaml --excluded-charts=everest,psmdb-operator-crds | |
| 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 |