Skip to content

Commit

Permalink
chore(ci): install prometheus operator CRDs in order to be able to te…
Browse files Browse the repository at this point in the history
…st ServiceMonitors / PrometheusRules / etc validity in charts. (#4715)
  • Loading branch information
desaintmartin authored Jul 11, 2024
1 parent 5d9b323 commit 73787aa
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
changed="$(ct list-changed --config .github/linters/ct.yaml)"
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "changed_list=\"${changed//$'\n'/ }\"" >> "$GITHUB_OUTPUT"
fi
# - name: install helm unittest plugin
Expand All @@ -48,5 +49,18 @@ jobs:
run: kubectl apply -k https://github.com/kubernetes-sigs/gateway-api/config/crd
if: steps.list-changed.outputs.changed == 'true'

- name: Apply Prometheus Operator CRDs (unless for charts already installing it)
env:
CHANGED_LIST: ${{ steps.list-changed.outputs.changed_list }}
run: |
# Always run unless only changed chart is one of impacted charts
echo "List is: $CHANGED_LIST"
if [ "$CHANGED_LIST" = '"charts/kube-prometheus-stack"' ] || [ "$CHANGED_LIST" = '"charts/prometheus-operator-crds"' ]; then
echo "Skipping install"
else
helm install prometheus-operator-crds oci://ghcr.io/prometheus-community/charts/prometheus-operator-crds
fi
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
run: ct install --config .github/linters/ct.yaml

0 comments on commit 73787aa

Please sign in to comment.