test: add build targets for unused media test

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson
2024-05-20 18:56:51 +02:00
parent aee1cfc81d
commit 761fa899e0
2 changed files with 13 additions and 1 deletions

View File

@@ -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 /

View File

@@ -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