Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/helm-lint-test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint and test Helm chart
name: Lint and test chart

on:
pull_request:
Expand Down Expand Up @@ -27,7 +27,7 @@ jobs:
uses: helm/[email protected]

- name: Run chart-testing (lint)
run: ct lint --config deployment/ct.yaml
run: ct lint --config deployment/ct.yaml --check-version-increment=false

- name: Create kind cluster
uses: helm/[email protected]
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/version-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Validate versions

on:
pull_request:
branches:
- 'release-*'
- gh-pages

jobs:
validate-versions:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get target branch
id: branch
run: |
echo "target=${{ github.base_ref }}" >> $GITHUB_OUTPUT

- name: Validate release branch versions
if: startsWith(steps.branch.outputs.target, 'release-')
run: |
BRANCH="${{ steps.branch.outputs.target }}"
SEMVER="${BRANCH#release-}"

# Validate semver format
if ! [[ "$SEMVER" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "❌ Branch name must follow 'release-X.Y.Z' semver format"
exit 1
fi

CHART_VERSION=$(yq eval '.version' deployment/console-plugin-nvidia-gpu/Chart.yaml)
APP_VERSION=$(yq eval '.appVersion' deployment/console-plugin-nvidia-gpu/Chart.yaml)

if [[ "$CHART_VERSION" != "$SEMVER" ]]; then
echo "❌ Chart version must be '$SEMVER', found '$CHART_VERSION'"
exit 1
fi

if [[ "$APP_VERSION" != "v${SEMVER}" && "$APP_VERSION" != "release-${SEMVER}" ]]; then
echo "❌ appVersion must be 'v${SEMVER}' or 'release-${SEMVER}', found '$APP_VERSION'"
exit 1
fi

echo "✓ Versions match branch"

- name: Validate gh-pages index.yaml
if: steps.branch.outputs.target == 'gh-pages'
run: |
# Check for duplicate versions
DUPLICATES=$(yq eval '.entries.console-plugin-nvidia-gpu[].version' index.yaml | sort | uniq -d)
if [[ -n "$DUPLICATES" ]]; then
echo "❌ Duplicate versions: $DUPLICATES"
exit 1
fi

# Check if any appVersion doesn't match v{version} or release-{version}
INVALID=$(yq eval '.entries.console-plugin-nvidia-gpu[] | select(.appVersion != "v" + .version and .appVersion != "release-" + .version) | .version' index.yaml)
if [[ -n "$INVALID" ]]; then
echo "❌ Invalid appVersion for versions: $INVALID"
echo " appVersion must be 'v{version}' or 'release-{version}'"
exit 1
fi

COUNT=$(yq eval '.entries.console-plugin-nvidia-gpu | length' index.yaml)
echo "✓ All $COUNT versions valid"