Use docker container for link check

This commit is contained in:
TheAssassin 2021-11-28 21:53:09 +01:00
parent a718c89e07
commit 604acd36d1
3 changed files with 32 additions and 25 deletions

View File

@ -1,25 +0,0 @@
name: linkcheck
on:
push:
branches:
- master
pull_request:
jobs:
linkcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up python 3
uses: actions/setup-python@v2
with:
python-version: '3.x'
cache: 'pip'
- name: install dependencies
run: pip install -r requirements.txt
- name: Verify links
run: python linkcheck.py

16
.github/workflows/linkcheck.yml vendored Normal file
View File

@ -0,0 +1,16 @@
name: linkcheck
on:
push:
branches:
- master
pull_request:
jobs:
linkcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Verify links
run: bash ci/docker-linkcheck.sh

16
ci/docker-linkcheck.sh Normal file
View File

@ -0,0 +1,16 @@
#! /bin/bash
set -e
set -o pipefail
set -x
this_dir="$(readlink -f -- "$(dirname -- "${BASH_SOURCE[0]}")")"
image="python:3-alpine"
# as we use a pipe to stdin and thus cannot use -it, Ctrl-C does not work by default
# turns out that combining -i with --init solves that problem
# see https://stackoverflow.com/a/60812082
docker run --rm -i -v "$this_dir"/..:/ws -w /ws --init "$image" sh <<\EOF
pip install -r requirements.txt
python linkcheck.py
EOF