mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-22 19:06:09 +08:00
Merge pull request #479 from crazy-max/dockerfile-validate
dockerfile validation
This commit is contained in:
commit
e84b18afd5
11
.github/workflows/validate.yml
vendored
11
.github/workflows/validate.yml
vendored
@ -17,16 +17,17 @@ jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-20.04
|
||||
outputs:
|
||||
targets: ${{ steps.targets.outputs.matrix }}
|
||||
targets: ${{ steps.generate.outputs.targets }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Matrix
|
||||
id: targets
|
||||
run: |
|
||||
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
|
||||
name: List targets
|
||||
id: generate
|
||||
uses: docker/bake-action/subaction/list-targets@v5
|
||||
with:
|
||||
target: validate
|
||||
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -74,9 +74,9 @@ RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run lint
|
||||
|
||||
FROM docker:${DOCKER_VERSION} as docker
|
||||
FROM docker/buildx-bin:${BUILDX_VERSION} as buildx
|
||||
FROM crazymax/undock:${UNDOCK_VERSION} as undock
|
||||
FROM docker:${DOCKER_VERSION} AS docker
|
||||
FROM docker/buildx-bin:${BUILDX_VERSION} AS buildx
|
||||
FROM crazymax/undock:${UNDOCK_VERSION} AS undock
|
||||
|
||||
FROM deps AS test
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
|
@ -21,7 +21,7 @@ group "pre-checkin" {
|
||||
}
|
||||
|
||||
group "validate" {
|
||||
targets = ["lint", "vendor-validate", "license-validate"]
|
||||
targets = ["lint", "vendor-validate", "dockerfile-validate", "license-validate"]
|
||||
}
|
||||
|
||||
target "build" {
|
||||
@ -54,6 +54,18 @@ target "vendor-validate" {
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "dockerfile-validate" {
|
||||
matrix = {
|
||||
dockerfile = [
|
||||
"dev.Dockerfile",
|
||||
"./hack/dockerfiles/license.Dockerfile"
|
||||
]
|
||||
}
|
||||
name = "dockerfile-validate-${md5(dockerfile)}"
|
||||
dockerfile = dockerfile
|
||||
call = "check"
|
||||
}
|
||||
|
||||
target "test" {
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "test"
|
||||
|
Loading…
Reference in New Issue
Block a user