ci: run lint and validate tools locally
This commit is contained in:
+24
-21
@@ -28,11 +28,12 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker run --rm \
|
command -v prettier >/dev/null 2>&1 || {
|
||||||
-v "$PWD:/work" \
|
echo "prettier is required on PATH but was not found."
|
||||||
-w /work \
|
exit 1
|
||||||
node:22-alpine \
|
}
|
||||||
sh -lc 'npx --yes prettier@3 --check --ignore-unknown "$@"' sh "${prettier_files[@]}"
|
|
||||||
|
prettier --check --ignore-unknown "${prettier_files[@]}"
|
||||||
|
|
||||||
ruff:
|
ruff:
|
||||||
runs-on: [self-hosted, linux, arch, homelab]
|
runs-on: [self-hosted, linux, arch, homelab]
|
||||||
@@ -43,11 +44,12 @@ jobs:
|
|||||||
- name: Lint Python with Ruff
|
- name: Lint Python with Ruff
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
command -v ruff >/dev/null 2>&1 || {
|
||||||
-v "$PWD:/work" \
|
echo "ruff is required on PATH but was not found."
|
||||||
-w /work \
|
exit 1
|
||||||
ghcr.io/astral-sh/ruff:latest \
|
}
|
||||||
check .
|
|
||||||
|
ruff check .
|
||||||
|
|
||||||
yamllint:
|
yamllint:
|
||||||
runs-on: [self-hosted, linux, arch, homelab]
|
runs-on: [self-hosted, linux, arch, homelab]
|
||||||
@@ -58,11 +60,12 @@ jobs:
|
|||||||
- name: Lint YAML syntax
|
- name: Lint YAML syntax
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
command -v yamllint >/dev/null 2>&1 || {
|
||||||
-v "$PWD:/work" \
|
echo "yamllint is required on PATH but was not found."
|
||||||
-w /work \
|
exit 1
|
||||||
cytopia/yamllint:latest \
|
}
|
||||||
-c .yamllint .
|
|
||||||
|
yamllint -c .yamllint .
|
||||||
|
|
||||||
hadolint:
|
hadolint:
|
||||||
runs-on: [self-hosted, linux, arch, homelab]
|
runs-on: [self-hosted, linux, arch, homelab]
|
||||||
@@ -82,9 +85,9 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker run --rm \
|
command -v hadolint >/dev/null 2>&1 || {
|
||||||
-v "$PWD:/work" \
|
echo "hadolint is required on PATH but was not found."
|
||||||
-w /work \
|
exit 1
|
||||||
--entrypoint hadolint \
|
}
|
||||||
hadolint/hadolint:latest-debian \
|
|
||||||
-c .hadolint.yaml "${dockerfiles[@]}"
|
hadolint -c .hadolint.yaml "${dockerfiles[@]}"
|
||||||
|
|||||||
@@ -17,11 +17,12 @@ jobs:
|
|||||||
- name: Lint YAML syntax
|
- name: Lint YAML syntax
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
command -v yamllint >/dev/null 2>&1 || {
|
||||||
-v "$PWD:/work" \
|
echo "yamllint is required on PATH but was not found."
|
||||||
-w /work \
|
exit 1
|
||||||
cytopia/yamllint:latest \
|
}
|
||||||
-c .yamllint .
|
|
||||||
|
yamllint -c .yamllint .
|
||||||
|
|
||||||
k8s:
|
k8s:
|
||||||
runs-on: [self-hosted, linux, arch, homelab]
|
runs-on: [self-hosted, linux, arch, homelab]
|
||||||
@@ -42,11 +43,9 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker run --rm \
|
command -v kubeconform >/dev/null 2>&1 || {
|
||||||
-v "$PWD:/work" \
|
echo "kubeconform is required on PATH but was not found."
|
||||||
-w /work \
|
exit 1
|
||||||
ghcr.io/yannh/kubeconform:latest \
|
}
|
||||||
-strict \
|
|
||||||
-ignore-missing-schemas \
|
kubeconform -strict -ignore-missing-schemas -summary "${manifests[@]}"
|
||||||
-summary \
|
|
||||||
"${manifests[@]}"
|
|
||||||
|
|||||||
+24
-21
@@ -28,11 +28,12 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker run --rm \
|
command -v prettier >/dev/null 2>&1 || {
|
||||||
-v "$PWD:/work" \
|
echo "prettier is required on PATH but was not found."
|
||||||
-w /work \
|
exit 1
|
||||||
node:22-alpine \
|
}
|
||||||
sh -lc 'npx --yes prettier@3 --check --ignore-unknown "$@"' sh "${prettier_files[@]}"
|
|
||||||
|
prettier --check --ignore-unknown "${prettier_files[@]}"
|
||||||
|
|
||||||
ruff:
|
ruff:
|
||||||
runs-on: [self-hosted, linux, arch, homelab]
|
runs-on: [self-hosted, linux, arch, homelab]
|
||||||
@@ -43,11 +44,12 @@ jobs:
|
|||||||
- name: Lint Python with Ruff
|
- name: Lint Python with Ruff
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
command -v ruff >/dev/null 2>&1 || {
|
||||||
-v "$PWD:/work" \
|
echo "ruff is required on PATH but was not found."
|
||||||
-w /work \
|
exit 1
|
||||||
ghcr.io/astral-sh/ruff:latest \
|
}
|
||||||
check .
|
|
||||||
|
ruff check .
|
||||||
|
|
||||||
yamllint:
|
yamllint:
|
||||||
runs-on: [self-hosted, linux, arch, homelab]
|
runs-on: [self-hosted, linux, arch, homelab]
|
||||||
@@ -58,11 +60,12 @@ jobs:
|
|||||||
- name: Lint YAML syntax
|
- name: Lint YAML syntax
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
command -v yamllint >/dev/null 2>&1 || {
|
||||||
-v "$PWD:/work" \
|
echo "yamllint is required on PATH but was not found."
|
||||||
-w /work \
|
exit 1
|
||||||
cytopia/yamllint:latest \
|
}
|
||||||
-c .yamllint .
|
|
||||||
|
yamllint -c .yamllint .
|
||||||
|
|
||||||
hadolint:
|
hadolint:
|
||||||
runs-on: [self-hosted, linux, arch, homelab]
|
runs-on: [self-hosted, linux, arch, homelab]
|
||||||
@@ -82,9 +85,9 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker run --rm \
|
command -v hadolint >/dev/null 2>&1 || {
|
||||||
-v "$PWD:/work" \
|
echo "hadolint is required on PATH but was not found."
|
||||||
-w /work \
|
exit 1
|
||||||
--entrypoint hadolint \
|
}
|
||||||
hadolint/hadolint:latest-debian \
|
|
||||||
-c .hadolint.yaml "${dockerfiles[@]}"
|
hadolint -c .hadolint.yaml "${dockerfiles[@]}"
|
||||||
|
|||||||
@@ -17,11 +17,12 @@ jobs:
|
|||||||
- name: Lint YAML syntax
|
- name: Lint YAML syntax
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
command -v yamllint >/dev/null 2>&1 || {
|
||||||
-v "$PWD:/work" \
|
echo "yamllint is required on PATH but was not found."
|
||||||
-w /work \
|
exit 1
|
||||||
cytopia/yamllint:latest \
|
}
|
||||||
-c .yamllint .
|
|
||||||
|
yamllint -c .yamllint .
|
||||||
|
|
||||||
k8s:
|
k8s:
|
||||||
runs-on: [self-hosted, linux, arch, homelab]
|
runs-on: [self-hosted, linux, arch, homelab]
|
||||||
@@ -42,11 +43,9 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker run --rm \
|
command -v kubeconform >/dev/null 2>&1 || {
|
||||||
-v "$PWD:/work" \
|
echo "kubeconform is required on PATH but was not found."
|
||||||
-w /work \
|
exit 1
|
||||||
ghcr.io/yannh/kubeconform:latest \
|
}
|
||||||
-strict \
|
|
||||||
-ignore-missing-schemas \
|
kubeconform -strict -ignore-missing-schemas -summary "${manifests[@]}"
|
||||||
-summary \
|
|
||||||
"${manifests[@]}"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user