ci: run lint and validate tools locally
ci / lint-dockerfiles (push) Failing after 1s
ci / validate (push) Failing after 1s
ci / publish (push) Has been skipped
ci / lint-prettier (push) Failing after 3s
ci / lint-ruff (push) Successful in 1s
ci / lint-yaml (push) Successful in 1s

This commit is contained in:
2026-06-30 00:15:02 +02:00
parent 145e7de7f4
commit 849bf97c97
2 changed files with 60 additions and 58 deletions
+30 -29
View File
@@ -33,11 +33,12 @@ jobs:
exit 0
fi
docker run --rm \
-v "$PWD:/work" \
-w /work \
node:22-alpine \
sh -lc 'npx --yes prettier@3 --check --ignore-unknown "$@"' sh "${prettier_files[@]}"
command -v prettier >/dev/null 2>&1 || {
echo "prettier is required on PATH but was not found."
exit 1
}
prettier --check --ignore-unknown "${prettier_files[@]}"
lint-ruff:
runs-on: [self-hosted, linux, arch, homelab]
@@ -48,11 +49,12 @@ jobs:
- name: Lint Python with Ruff
shell: bash
run: |
docker run --rm \
-v "$PWD:/work" \
-w /work \
ghcr.io/astral-sh/ruff:latest \
check .
command -v ruff >/dev/null 2>&1 || {
echo "ruff is required on PATH but was not found."
exit 1
}
ruff check .
lint-yaml:
runs-on: [self-hosted, linux, arch, homelab]
@@ -63,11 +65,12 @@ jobs:
- name: Lint YAML syntax
shell: bash
run: |
docker run --rm \
-v "$PWD:/work" \
-w /work \
cytopia/yamllint:latest \
-c .yamllint .
command -v yamllint >/dev/null 2>&1 || {
echo "yamllint is required on PATH but was not found."
exit 1
}
yamllint -c .yamllint .
lint-dockerfiles:
runs-on: [self-hosted, linux, arch, homelab]
@@ -87,12 +90,12 @@ jobs:
exit 0
fi
docker run --rm \
-v "$PWD:/work" \
-w /work \
--entrypoint hadolint \
hadolint/hadolint:latest-debian \
-c .hadolint.yaml "${dockerfiles[@]}"
command -v hadolint >/dev/null 2>&1 || {
echo "hadolint is required on PATH but was not found."
exit 1
}
hadolint -c .hadolint.yaml "${dockerfiles[@]}"
validate:
runs-on: [self-hosted, linux, arch, homelab]
@@ -113,14 +116,12 @@ jobs:
exit 0
fi
docker run --rm \
-v "$PWD:/work" \
-w /work \
ghcr.io/yannh/kubeconform:latest \
-strict \
-ignore-missing-schemas \
-summary \
"${manifests[@]}"
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[@]}"
publish:
needs: [lint-prettier, lint-ruff, lint-yaml, lint-dockerfiles, validate]
+30 -29
View File
@@ -33,11 +33,12 @@ jobs:
exit 0
fi
docker run --rm \
-v "$PWD:/work" \
-w /work \
node:22-alpine \
sh -lc 'npx --yes prettier@3 --check --ignore-unknown "$@"' sh "${prettier_files[@]}"
command -v prettier >/dev/null 2>&1 || {
echo "prettier is required on PATH but was not found."
exit 1
}
prettier --check --ignore-unknown "${prettier_files[@]}"
lint-ruff:
runs-on: [self-hosted, linux, arch, homelab]
@@ -48,11 +49,12 @@ jobs:
- name: Lint Python with Ruff
shell: bash
run: |
docker run --rm \
-v "$PWD:/work" \
-w /work \
ghcr.io/astral-sh/ruff:latest \
check .
command -v ruff >/dev/null 2>&1 || {
echo "ruff is required on PATH but was not found."
exit 1
}
ruff check .
lint-yaml:
runs-on: [self-hosted, linux, arch, homelab]
@@ -63,11 +65,12 @@ jobs:
- name: Lint YAML syntax
shell: bash
run: |
docker run --rm \
-v "$PWD:/work" \
-w /work \
cytopia/yamllint:latest \
-c .yamllint .
command -v yamllint >/dev/null 2>&1 || {
echo "yamllint is required on PATH but was not found."
exit 1
}
yamllint -c .yamllint .
lint-dockerfiles:
runs-on: [self-hosted, linux, arch, homelab]
@@ -87,12 +90,12 @@ jobs:
exit 0
fi
docker run --rm \
-v "$PWD:/work" \
-w /work \
--entrypoint hadolint \
hadolint/hadolint:latest-debian \
-c .hadolint.yaml "${dockerfiles[@]}"
command -v hadolint >/dev/null 2>&1 || {
echo "hadolint is required on PATH but was not found."
exit 1
}
hadolint -c .hadolint.yaml "${dockerfiles[@]}"
validate:
runs-on: [self-hosted, linux, arch, homelab]
@@ -113,14 +116,12 @@ jobs:
exit 0
fi
docker run --rm \
-v "$PWD:/work" \
-w /work \
ghcr.io/yannh/kubeconform:latest \
-strict \
-ignore-missing-schemas \
-summary \
"${manifests[@]}"
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[@]}"
publish:
needs: [lint-prettier, lint-ruff, lint-yaml, lint-dockerfiles, validate]