ci: add yamllint

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2024-07-12 17:32:55 -07:00
parent 0d37d68efd
commit c46193baba
No known key found for this signature in database
GPG Key ID: AFA9DE5F8AB7AF39
4 changed files with 54 additions and 41 deletions

1
.github/labeler.yml vendored
View File

@ -1,4 +1,3 @@
# Add 'area/project' label to changes in basic project documentation and .github folder, excluding .github/workflows
area/project:
- all:

View File

@ -31,7 +31,7 @@ group "default" {
}
group "validate" {
targets = ["lint", "lint-gopls", "validate-golangci", "validate-vendor", "validate-docs"]
targets = ["lint", "lint-gopls", "lint-yaml", "validate-golangci", "validate-vendor", "validate-docs"]
}
target "lint" {
@ -64,6 +64,14 @@ target "lint-gopls" {
target = "gopls-analyze"
}
target "lint-yaml" {
description = "Lint Github Actions workflows and other YAML files"
inherits = ["_common"]
dockerfile = "./hack/dockerfiles/lint.Dockerfile"
target = "yamllint"
output = ["type=cacheonly"]
}
target "validate-vendor" {
inherits = ["_common"]
dockerfile = "./hack/dockerfiles/vendor.Dockerfile"

View File

@ -75,4 +75,10 @@ RUN --mount=target=. \
done
EOF
FROM alpine AS yamllint
RUN apk add --no-cache yamllint
WORKDIR /go/src/github.com/docker/buildx
RUN --mount=type=bind \
yamllint -c .yamllint.yml --strict .
FROM lint