diff --git a/.Dockerfile.link-checks b/.Dockerfile.link-checks new file mode 100644 index 00000000000..2d510d07bbb --- /dev/null +++ b/.Dockerfile.link-checks @@ -0,0 +1,22 @@ +# This file is part of the SV-Benchmarks collection of verification tasks: +# https://github.com/sosy-lab/sv-benchmarks +# +# SPDX-FileCopyrightText: 2011-2021 The SV-Benchmarks Community +# +# SPDX-License-Identifier: Apache-2.0 + +# This is a Docker image for running the sanity checks. +# It should be pushed to registry.gitlab.com/sosy-lab/software/sv-benchmarks/ci/sanity-checks +# and will be used by CI as declared in .gitlab-ci.yml. +# +# Commands for updating the image: +# docker build --pull -t registry.gitlab.com/sosy-lab/software/sv-benchmarks/ci/link-checks:latest - < .Dockerfile.link-checks +# docker push registry.gitlab.com/sosy-lab/software/sv-benchmarks/ci/link-checks + +FROM python:3 + +RUN apt-get update && apt-get install -y pandoc \ + && rm -rf /var/lib/apt/lists/* + +RUN pip3 install \ + linkchecker diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6383bf53a1b..135615b394e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -126,10 +126,10 @@ java-format: check-links: stage: checks - image: - name: ghcr.io/tcort/markdown-link-check:stable - entrypoint: [""] - script: "find . -name '*.md' | xargs -n 1 /src/markdown-link-check" + image: "$CI_REGISTRY/sosy-lab/software/sv-benchmarks/ci/link-checks:latest" + script: + - "set -o pipefail" + - "for md in $(find . -name '*.md'); do pandoc -t html5 \"$md\" -o \"$md\".html; echo -e \"\\n\\nFILE: $md\"; linkchecker --check-extern --config .linkchecker.config \"$md\".html; rm \"$md\".html; done" .build-docker: image: @@ -178,6 +178,13 @@ build-docker:java:latest: DOCKERFILE: java/.Dockerfile IMAGE: ci/java:latest +build-docker:link-checks:latest: + extends: .build-docker + stage: images + variables: + DOCKERFILE: .Dockerfile.link-checks + IMAGE: ci/link-checks:latest + # check license declarations etc. reuse: diff --git a/.linkchecker.config b/.linkchecker.config new file mode 100644 index 00000000000..70107ab7972 --- /dev/null +++ b/.linkchecker.config @@ -0,0 +1,15 @@ +# This file is part of the SV-Benchmarks collection of verification tasks: +# https://github.com/sosy-lab/sv-benchmarks +# +# SPDX-FileCopyrightText: 2021 The SV-Benchmarks Community +# +# SPDX-License-Identifier: Apache-2.0 + +[checking] +recursionlevel=1 + +[output] +status=0 + +[text] +parts=realurl,result,extern,base,name,parenturl,info,warning,url,outro \ No newline at end of file