Skip to content

ohoffman/modify priority class default values #90

ohoffman/modify priority class default values

ohoffman/modify priority class default values #90

Workflow file for this run

name: Lint and Test Charts
on: pull_request
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: v3.13.0
# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
# yamllint (https://github.com/adrienverge/yamllint) which require Python
- name: Set up Python
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: 3.12
- name: Set up chart-testing
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0
- name: Validate konnector chart version
shell: bash
run: |
set -euo pipefail
CHART="charts/konnector/Chart.yaml"
if [[ ! -f "$CHART" ]]; then
echo "::error::$CHART not found"
exit 1
fi
# Extract version
VERSION=$(sed -nE 's/^version:[[:space:]]*([^[:space:]]+)/\1/p' "$CHART" | head -n1)
if [[ -z "$VERSION" ]]; then
echo "::error file=$CHART::Unable to extract version from Chart.yaml"
exit 1
fi
echo "Detected konnector chart version: $VERSION"
# Branch detection
BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
BASE_BRANCH="${GITHUB_BASE_REF:-}"
# Regex
STABLE_REGEX='^[0-9]+\.[0-9]+\.[0-9]+$'
PRERELEASE_REGEX='^[0-9]+\.[0-9]+\.[0-9]+-(rc|beta|alpha)\.[0-9]+$'
# Release branch check
if [[ "$BRANCH" == release/* ]]; then
if [[ ! "$VERSION" =~ $PRERELEASE_REGEX ]]; then
echo "::error file=$CHART::release/* branch requires pre-release version (X.Y.Z-rc.N | beta | alpha). Found: $VERSION"
exit 1
fi
fi
# Main branch check
if [[ "$BASE_BRANCH" == "main" || "$BRANCH" == "main" ]]; then
if [[ ! "$VERSION" =~ $STABLE_REGEX ]]; then
echo "::error file=$CHART::main branch requires stable version (X.Y.Z). Found: $VERSION"
exit 1
fi
fi
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml)
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Run chart-testing (lint)
run: ct lint --config ct.yaml
- name: Create kind cluster
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
if: steps.list-changed.outputs.changed == 'true'
- name: Create 'pan' namespace
if: steps.list-changed.outputs.changed == 'true'
run: kubectl create namespace pan
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --config ct.yaml