Skip to content
This repository has been archived by the owner on Oct 3, 2021. It is now read-only.

Replace check-markdown-links with pandoc + linkchecker #1307

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .Dockerfile.link-checks
Original file line number Diff line number Diff line change
@@ -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
15 changes: 11 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
15 changes: 15 additions & 0 deletions .linkchecker.config
Original file line number Diff line number Diff line change
@@ -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