Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI workflow for helm charts and manifests #5027

Merged
merged 8 commits into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/validate-helm-charts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Validate helm charts & manifests

on:
pull_request:
branches:
- master
paths:
- deployment
- docker/sandbox-bundled/manifests

jobs:
lint-and-test-charts:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: charts

- name: Install Helm
uses: azure/setup-helm@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@v2

- name: Detect charts changed (list-changed)
id: charts-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Run chart-testing (lint)
if: steps.charts-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}

- name: Create KinD cluster
if: steps.charts-changed.outputs.changed == 'true'
uses: helm/kind-action@v1

- name: Run chart-testing (install)
if: steps.charts-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}

validate-manifests:
needs:
- lint-and-test-charts
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
matrix:
k8s_versions: [ "1.29.2", "1.28.7", "1.27.11" ]

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
sparse-checkout: |
deployment
docker/sandbox-bundled/manifests

- name: Install Helm
uses: azure/setup-helm@v4

- name: Install kubeconform
run: |
curl -L -o kubeconform.tar.gz https://github.com/yannh/kubeconform/releases/download/v0.6.4/kubeconform-linux-amd64.tar.gz
tar -zvxf kubeconform.tar.gz
chmod +x kubeconform
sudo mv kubeconform /usr/local/bin/kubeconform

- name: Validate manifests
run: |
kubeconform -strict -summary -skip CustomResourceDefinition -ignore-filename-pattern "deployment/stats/prometheus/*" -kubernetes-version ${{ matrix.k8s_versions }} ./deployment ./docker/sandbox-bundled/manifests
Loading