From a74b8bfd14cac540a3935b561e625c24459b3245 Mon Sep 17 00:00:00 2001 From: mr-forust Date: Sun, 28 Jun 2026 00:36:17 +0200 Subject: [PATCH] Run CI linters without Docker --- .gitea/workflows/ci.yaml | 59 +++++++++++++++++---------------------- .github/workflows/ci.yaml | 59 +++++++++++++++++---------------------- 2 files changed, 52 insertions(+), 66 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index eac1f98..14d4c55 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -18,6 +18,16 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Check lint toolchain + shell: bash + run: | + for tool in prettier ruff yamllint hadolint; do + command -v "$tool" >/dev/null || { + echo "Missing required tool: $tool" >&2 + exit 1 + } + done + - name: Check formatting with Prettier shell: bash run: | @@ -32,29 +42,15 @@ 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[@]}" + prettier --check --ignore-unknown "${prettier_files[@]}" - name: Lint Python with Ruff shell: bash - run: | - docker run --rm \ - -v "$PWD:/work" \ - -w /work \ - ghcr.io/astral-sh/ruff:latest \ - check . + run: ruff check . - name: Lint YAML syntax shell: bash - run: | - docker run --rm \ - -v "$PWD:/work" \ - -w /work \ - cytopia/yamllint:latest \ - -c .yamllint . + run: yamllint -c .yamllint . - name: Lint Dockerfiles shell: bash @@ -68,12 +64,7 @@ jobs: exit 0 fi - docker run --rm \ - -v "$PWD:/work" \ - -w /work \ - --entrypoint hadolint \ - hadolint/hadolint:latest-debian \ - -c .hadolint.yaml "${dockerfiles[@]}" + hadolint -c .hadolint.yaml "${dockerfiles[@]}" validate: runs-on: [self-hosted, linux, arch, homelab] @@ -81,14 +72,19 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Lint YAML syntax + - name: Check validation toolchain shell: bash run: | - docker run --rm \ - -v "$PWD:/work" \ - -w /work \ - cytopia/yamllint:latest \ - -c .yamllint . + for tool in yamllint kubeconform; do + command -v "$tool" >/dev/null || { + echo "Missing required tool: $tool" >&2 + exit 1 + } + done + + - name: Lint YAML syntax + shell: bash + run: yamllint -c .yamllint . - name: Validate Kubernetes manifests shell: bash @@ -103,10 +99,7 @@ jobs: exit 0 fi - docker run --rm \ - -v "$PWD:/work" \ - -w /work \ - ghcr.io/yannh/kubeconform:latest \ + kubeconform \ -strict \ -ignore-missing-schemas \ -summary \ diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index eac1f98..14d4c55 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,6 +18,16 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Check lint toolchain + shell: bash + run: | + for tool in prettier ruff yamllint hadolint; do + command -v "$tool" >/dev/null || { + echo "Missing required tool: $tool" >&2 + exit 1 + } + done + - name: Check formatting with Prettier shell: bash run: | @@ -32,29 +42,15 @@ 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[@]}" + prettier --check --ignore-unknown "${prettier_files[@]}" - name: Lint Python with Ruff shell: bash - run: | - docker run --rm \ - -v "$PWD:/work" \ - -w /work \ - ghcr.io/astral-sh/ruff:latest \ - check . + run: ruff check . - name: Lint YAML syntax shell: bash - run: | - docker run --rm \ - -v "$PWD:/work" \ - -w /work \ - cytopia/yamllint:latest \ - -c .yamllint . + run: yamllint -c .yamllint . - name: Lint Dockerfiles shell: bash @@ -68,12 +64,7 @@ jobs: exit 0 fi - docker run --rm \ - -v "$PWD:/work" \ - -w /work \ - --entrypoint hadolint \ - hadolint/hadolint:latest-debian \ - -c .hadolint.yaml "${dockerfiles[@]}" + hadolint -c .hadolint.yaml "${dockerfiles[@]}" validate: runs-on: [self-hosted, linux, arch, homelab] @@ -81,14 +72,19 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Lint YAML syntax + - name: Check validation toolchain shell: bash run: | - docker run --rm \ - -v "$PWD:/work" \ - -w /work \ - cytopia/yamllint:latest \ - -c .yamllint . + for tool in yamllint kubeconform; do + command -v "$tool" >/dev/null || { + echo "Missing required tool: $tool" >&2 + exit 1 + } + done + + - name: Lint YAML syntax + shell: bash + run: yamllint -c .yamllint . - name: Validate Kubernetes manifests shell: bash @@ -103,10 +99,7 @@ jobs: exit 0 fi - docker run --rm \ - -v "$PWD:/work" \ - -w /work \ - ghcr.io/yannh/kubeconform:latest \ + kubeconform \ -strict \ -ignore-missing-schemas \ -summary \