From 761fa899e0f09d756c799fc02561a85072968fae Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Mon, 20 May 2024 18:56:51 +0200 Subject: [PATCH] test: add build targets for unused media test Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- Dockerfile | 7 +++++++ docker-bake.hcl | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 92659baf74..206895b7ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # syntax=docker/dockerfile:1 +ARG ALPINE_VERSION=3.19 ARG GO_VERSION=1.21 ARG HTMLTEST_VERSION=0.17.0 @@ -76,5 +77,11 @@ COPY --from=build-upstream /out ./public ADD .htmltest.yml .htmltest.yml RUN htmltest +FROM alpine:${ALPINE_VERSION} AS unused-media +RUN apk add --no-cache fd ripgrep +WORKDIR /test +RUN --mount=type=bind,target=. \ + ./scripts/test_unused_media.sh + FROM scratch AS release COPY --from=build /out / diff --git a/docker-bake.hcl b/docker-bake.hcl index 71036457da..0905e1cc9c 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -27,7 +27,7 @@ target "release" { } group "validate" { - targets = ["lint", "test"] + targets = ["lint", "test", "unused-media"] } target "test" { @@ -40,6 +40,11 @@ target "lint" { output = ["type=cacheonly"] } +target "unused-media" { + target = "unused-media" + output = ["type=cacheonly"] +} + # # releaser targets are defined in _releaser/Dockerfile # and are used for Netlify and AWS S3 deployment