Files
homelab/.gitea/workflows/validate.yaml
T
forust 8e72e0a920
lint / prettier (push) Failing after 2s
lint / ruff (push) Successful in 2s
lint / yamllint (push) Successful in 3s
lint / hadolint (push) Failing after 2s
validate / yaml (push) Successful in 2s
validate / k8s (push) Failing after 1s
ci: run lint and validate tools locally
2026-06-30 00:14:14 +02:00

52 lines
1.3 KiB
YAML

name: validate
on:
push:
branches:
- "**"
pull_request:
workflow_dispatch:
jobs:
yaml:
runs-on: [self-hosted, linux, arch, homelab]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Lint YAML syntax
shell: bash
run: |
command -v yamllint >/dev/null 2>&1 || {
echo "yamllint is required on PATH but was not found."
exit 1
}
yamllint -c .yamllint .
k8s:
runs-on: [self-hosted, linux, arch, homelab]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate Kubernetes manifests
shell: bash
run: |
mapfile -t manifests < <(
git ls-files ':(glob)**/k8s/**/*.yaml' ':(glob)**/k8s/**/*.yml' \
| grep -Ev '(^|/)(kustomization\.ya?ml|.*\.example\.ya?ml|.*values\.ya?ml|patch-.*\.ya?ml)$'
)
if [ "${#manifests[@]}" -eq 0 ]; then
echo "No Kubernetes manifests found."
exit 0
fi
command -v kubeconform >/dev/null 2>&1 || {
echo "kubeconform is required on PATH but was not found."
exit 1
}
kubeconform -strict -ignore-missing-schemas -summary "${manifests[@]}"