From 1596da6813df63e9ada28091b8dc51bd383b9590 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 12 Oct 2023 09:32:55 +0200 Subject: [PATCH] docs: add tests Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- docker-bake.hcl | 6 ++++++ dockerfiles/docs.Dockerfile | 7 +++++++ docs/.htmltest.yml | 9 +++++++++ 3 files changed, 22 insertions(+) create mode 100644 docs/.htmltest.yml diff --git a/docker-bake.hcl b/docker-bake.hcl index e6741878..2b7f25d6 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -111,3 +111,9 @@ target "docs-image" { output = ["type=docker"] tags = ["registry-docs:local"] } + +target "docs-test" { + inherits = ["_common_docs"] + target = "test" + output = ["type=cacheonly"] +} diff --git a/dockerfiles/docs.Dockerfile b/dockerfiles/docs.Dockerfile index 8b31345b..4d351b69 100644 --- a/dockerfiles/docs.Dockerfile +++ b/dockerfiles/docs.Dockerfile @@ -26,3 +26,10 @@ EXPOSE 1313 FROM scratch AS out COPY --from=build /out / + +FROM wjdp/htmltest:v0.17.0 AS test +WORKDIR /test +COPY --from=build /out ./public +ADD docs/.htmltest.yml .htmltest.yml +RUN --mount=type=cache,target=tmp/.htmltest \ + htmltest diff --git a/docs/.htmltest.yml b/docs/.htmltest.yml new file mode 100644 index 00000000..d02699b4 --- /dev/null +++ b/docs/.htmltest.yml @@ -0,0 +1,9 @@ +DirectoryPath: "public" +EnforceHTTPS: true +CheckDoctype: true +CheckExternal: true +IgnoreAltMissing: true +IgnoreAltEmpty: true +IgnoreEmptyHref: true +IgnoreInternalEmptyHash: true +IgnoreDirectoryMissingTrailingSlash: true