2021-07-07 07:04:15 +00:00
|
|
|
name: Lint and Test Charts
|
|
|
|
|
|
|
|
on:
|
2022-09-16 06:28:41 +00:00
|
|
|
pull_request:
|
2022-09-13 12:53:44 +00:00
|
|
|
types: [opened, synchronize, edited, reopened]
|
2021-07-07 07:04:15 +00:00
|
|
|
paths:
|
|
|
|
- 'charts/**'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint-docs:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-04-12 07:07:11 +00:00
|
|
|
uses: actions/checkout@v3.5.0
|
2021-07-07 07:04:15 +00:00
|
|
|
- name: Run helm-docs
|
|
|
|
run: .github/helm-docs.sh
|
|
|
|
install-chart:
|
|
|
|
name: install-chart
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs:
|
|
|
|
- lint-docs
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
k8s:
|
2023-04-12 07:07:11 +00:00
|
|
|
- v1.24.12
|
|
|
|
- v1.25.8
|
|
|
|
- v1.26.3
|
|
|
|
- v1.27.0
|
2021-07-07 07:04:15 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-04-12 07:07:11 +00:00
|
|
|
uses: actions/checkout@v3.5.0
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-07-07 07:04:15 +00:00
|
|
|
- name: Create kind ${{ matrix.k8s }} cluster
|
2023-01-25 15:16:23 +00:00
|
|
|
uses: helm/kind-action@v1.5.0
|
2021-07-07 07:04:15 +00:00
|
|
|
with:
|
|
|
|
node_image: kindest/node:${{ matrix.k8s }}
|
|
|
|
- name: Set up chart-testing
|
2023-04-12 07:07:11 +00:00
|
|
|
uses: helm/chart-testing-action@v2.4.0
|
2023-03-16 07:42:27 +00:00
|
|
|
- name: Add bitnami repo
|
|
|
|
run: helm repo add bitnami https://charts.bitnami.com/bitnami
|
|
|
|
- name: Add elastic repo
|
|
|
|
run: helm repo add elastic https://helm.elastic.co
|
2023-03-20 10:49:42 +00:00
|
|
|
- name: Add prometheus repo
|
|
|
|
run: helm repo add prometheus https://prometheus-community.github.io/helm-charts
|
|
|
|
- name: Add grafana repo
|
|
|
|
run: helm repo add grafana https://grafana.github.io/helm-charts
|
2021-07-07 07:04:15 +00:00
|
|
|
- name: Run chart-testing (list-changed)
|
|
|
|
id: list-changed
|
|
|
|
run: |
|
2023-04-12 07:07:11 +00:00
|
|
|
changed=$(ct list-changed --chart-dirs charts --target-branch main)
|
2021-07-07 07:04:15 +00:00
|
|
|
if [[ -n "$changed" ]]; then
|
2023-04-12 07:07:11 +00:00
|
|
|
echo "changed=true" >> "$GITHUB_OUTPUT"
|
|
|
|
echo "changed_charts=\"${changed//$'\n'/,}\"" >> "$GITHUB_OUTPUT"
|
2021-07-07 07:04:15 +00:00
|
|
|
fi
|
2023-04-13 15:44:58 +00:00
|
|
|
- name: Inject secrets
|
|
|
|
run: |
|
|
|
|
find ./charts/*/ci/*.yaml -type f -exec sed -i "s/AGENTK8SGLUEKEY/${{ secrets.AGENTK8SGLUEKEY }}/g" {} \;
|
|
|
|
find ./charts/*/ci/*.yaml -type f -exec sed -i "s/AGENTK8SGLUESECRET/${{ secrets.AGENTK8SGLUESECRET }}/g" {} \;
|
|
|
|
if: steps.list-changed.outputs.changed == 'true'
|
2021-07-07 07:04:15 +00:00
|
|
|
- name: Run chart-testing (lint and install)
|
2023-04-12 07:07:11 +00:00
|
|
|
run: ct lint-and-install --chart-dirs charts --target-branch main --helm-extra-args "--timeout=15m" --charts=${{steps.list-changed.outputs.changed_charts}} --debug true
|
2022-06-23 05:49:45 +00:00
|
|
|
if: steps.list-changed.outputs.changed == 'true'
|