|
|
|
|
@@ -17,7 +17,63 @@ env:
|
|
|
|
|
BASE_BRANCH: "origin/${{ gitea.base_ref }}"
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
lint-test:
|
|
|
|
|
chart-testing:
|
|
|
|
|
runs-on: ubuntu-js
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout
|
|
|
|
|
uses: actions/checkout@v6
|
|
|
|
|
with:
|
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
|
|
- name: Set up Helm
|
|
|
|
|
uses: azure/setup-helm@v4
|
|
|
|
|
with:
|
|
|
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
|
version: v3.19.2
|
|
|
|
|
|
|
|
|
|
- name: Set up Node.js
|
|
|
|
|
uses: actions/setup-node@v6
|
|
|
|
|
with:
|
|
|
|
|
node-version: '24'
|
|
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
|
uses: actions/setup-python@v6
|
|
|
|
|
with:
|
|
|
|
|
python-version: '3.14'
|
|
|
|
|
|
|
|
|
|
- name: Set up Chart Testing
|
|
|
|
|
uses: helm/chart-testing-action@v2.7.0
|
|
|
|
|
with:
|
|
|
|
|
yamale_version: "6.0.0"
|
|
|
|
|
|
|
|
|
|
- name: Run Chart Testing (list-changed)
|
|
|
|
|
id: list-changed
|
|
|
|
|
run: |
|
|
|
|
|
changed=$(ct list-changed --target-branch ${{ gitea.event.repository.default_branch }})
|
|
|
|
|
if [[ -n "$changed" ]]; then
|
|
|
|
|
echo "changed=true" >> $GITHUB_OUTPUT
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
- name: Run Chart Testing (lint)
|
|
|
|
|
if: steps.list-changed.outputs.changed == 'true'
|
|
|
|
|
run: ct lint --validate-maintainers=false --target-branch ${{ gitea.event.repository.default_branch }}
|
|
|
|
|
|
|
|
|
|
- name: ntfy Failed
|
|
|
|
|
uses: niniyas/ntfy-action@master
|
|
|
|
|
if: failure()
|
|
|
|
|
with:
|
|
|
|
|
url: '${{ secrets.NTFY_URL }}'
|
|
|
|
|
topic: '${{ secrets.NTFY_TOPIC }}'
|
|
|
|
|
title: 'Test Failure - Helm Charts'
|
|
|
|
|
priority: 3
|
|
|
|
|
headers: '{"Authorization": "Bearer ${{ secrets.NTFY_CRED }}"}'
|
|
|
|
|
tags: action,failed
|
|
|
|
|
details: 'Tests have failed for Helm Charts'
|
|
|
|
|
icon: 'https://cdn.jsdelivr.net/gh/selfhst/icons/png/gitea.png'
|
|
|
|
|
actions: '[{"action": "view", "label": "Open Gitea", "url": "https://gitea.alexlebens.dev/alexlebens/helm-charts/actions?workflow=lint-test.yaml", "clear": true}]'
|
|
|
|
|
image: true
|
|
|
|
|
|
|
|
|
|
lint-helm:
|
|
|
|
|
runs-on: ubuntu-js
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout
|
|
|
|
|
@@ -36,28 +92,25 @@ jobs:
|
|
|
|
|
id: branch-exists
|
|
|
|
|
if: github.event_name == 'push' || steps.check-branch-exists.outputs.exists == 'true' && github.event_name == 'pull_request'
|
|
|
|
|
run: |
|
|
|
|
|
if [ ${{ github.event_name == 'push' }} ]; then
|
|
|
|
|
echo ">> Action is from a push event, will continue with linting"
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
echo ">> Branch ${{ gitea.base_ref }} exists, will continue with linting"
|
|
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "----"
|
|
|
|
|
|
|
|
|
|
echo "exists=true" >> $GITEA_OUTPUT
|
|
|
|
|
|
|
|
|
|
- name: Set up Helm
|
|
|
|
|
uses: azure/setup-helm@v4
|
|
|
|
|
if: steps.branch-exists.outputs.exists == 'true'
|
|
|
|
|
with:
|
|
|
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
|
version: v3
|
|
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
|
uses: actions/setup-python@v6
|
|
|
|
|
with:
|
|
|
|
|
python-version: '3.14'
|
|
|
|
|
|
|
|
|
|
- name: Set up Chart Testing
|
|
|
|
|
uses: helm/chart-testing-action@v2.8.0
|
|
|
|
|
with:
|
|
|
|
|
yamale_version: "6.0.0"
|
|
|
|
|
|
|
|
|
|
- name: Check Directories for Changes
|
|
|
|
|
id: check-dir-changes
|
|
|
|
|
if: steps.branch-exists.outputs.exists == 'true'
|
|
|
|
|
@@ -83,6 +136,7 @@ jobs:
|
|
|
|
|
|
|
|
|
|
for path in $GIT_DIFF; do
|
|
|
|
|
CHANGED_CHARTS+=$(echo "$path" | awk -F '/' '{print $2}')
|
|
|
|
|
CHANGED_CHARTS+=$(echo " ")
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
@@ -94,13 +148,13 @@ jobs:
|
|
|
|
|
if [ -n "${CHANGED_CHARTS}" ]; then
|
|
|
|
|
echo ""
|
|
|
|
|
echo ">> Chart to Lint:"
|
|
|
|
|
echo "$(echo "${CHANGED_CHARTS[@]}" | sort -u)"
|
|
|
|
|
echo "$(echo "${CHANGED_CHARTS}" | sort -u)"
|
|
|
|
|
|
|
|
|
|
echo "----"
|
|
|
|
|
|
|
|
|
|
echo "changes-detected=true" >> $GITEA_OUTPUT
|
|
|
|
|
echo "chart-dir<<EOF" >> $GITEA_OUTPUT
|
|
|
|
|
echo "$(echo "${CHANGED_CHARTS[@]}" | sort -u)" >> $GITEA_OUTPUT
|
|
|
|
|
echo "$(echo "${CHANGED_CHARTS}" | sort -u)" >> $GITEA_OUTPUT
|
|
|
|
|
echo "EOF" >> $GITEA_OUTPUT
|
|
|
|
|
else
|
|
|
|
|
echo "changes-detected=false" >> $GITEA_OUTPUT
|
|
|
|
|
@@ -156,18 +210,6 @@ jobs:
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
- name: Run Chart Testing (list-changed)
|
|
|
|
|
id: list-changed
|
|
|
|
|
run: |
|
|
|
|
|
changed=$(ct list-changed --target-branch ${{ gitea.event.repository.default_branch }})
|
|
|
|
|
if [[ -n "$changed" ]]; then
|
|
|
|
|
echo "changed=true" >> $GITHUB_OUTPUT
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
- name: Run Chart Testing (lint)
|
|
|
|
|
if: steps.list-changed.outputs.changed == 'true'
|
|
|
|
|
run: ct lint --validate-maintainers=false --target-branch ${{ gitea.event.repository.default_branch }}
|
|
|
|
|
|
|
|
|
|
- name: ntfy Failed
|
|
|
|
|
uses: niniyas/ntfy-action@master
|
|
|
|
|
if: failure()
|
|
|
|
|
|