79 lines
1.8 KiB
YAML
79 lines
1.8 KiB
YAML
name: lint
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
prettier:
|
|
runs-on: [self-hosted, linux, arch, homelab]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Check formatting with Prettier
|
|
shell: bash
|
|
run: |
|
|
docker run --rm \
|
|
-v "$PWD:/work" \
|
|
-w /work \
|
|
node:22-alpine \
|
|
sh -lc 'npx --yes prettier@3 --check --ignore-unknown .'
|
|
|
|
ruff:
|
|
runs-on: [self-hosted, linux, arch, homelab]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Lint Python with Ruff
|
|
shell: bash
|
|
run: |
|
|
docker run --rm \
|
|
-v "$PWD:/work" \
|
|
-w /work \
|
|
ghcr.io/astral-sh/ruff:latest \
|
|
check .
|
|
|
|
yamllint:
|
|
runs-on: [self-hosted, linux, arch, homelab]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Lint YAML syntax
|
|
shell: bash
|
|
run: |
|
|
docker run --rm \
|
|
-v "$PWD:/work" \
|
|
-w /work \
|
|
cytopia/yamllint:latest \
|
|
-c .yamllint .
|
|
|
|
hadolint:
|
|
runs-on: [self-hosted, linux, arch, homelab]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Lint Dockerfiles
|
|
shell: bash
|
|
run: |
|
|
mapfile -t dockerfiles < <(
|
|
git ls-files ':(glob)**/Dockerfile' ':(glob)**/Dockerfile.*'
|
|
)
|
|
|
|
if [ "${#dockerfiles[@]}" -eq 0 ]; then
|
|
echo "No Dockerfiles found."
|
|
exit 0
|
|
fi
|
|
|
|
docker run --rm \
|
|
-v "$PWD:/work" \
|
|
-w /work \
|
|
hadolint/hadolint:latest-debian \
|
|
-c .hadolint.yaml "${dockerfiles[@]}"
|