Skip to content
Draft
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
26 changes: 26 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check links

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.9'
architecture: 'x64'

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt

- name: Check links
run: |
# This will not make anything fail on build, but at least we will know
pytest -s
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ docs/2023-24/year-1/t3
docs/2023-24/year-2/t2
docs/2023-24/year-2/t3
docs/2023-24/research-trip
docs/assets/images/zz
docs/assets/images/zz
*.log
2 changes: 2 additions & 0 deletions links.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/bash
mkdocs-linkcheck docs -r --exclude assets -v -l> tests/out.log 2>tests/err.log
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ mkdocs-macros-plugin
mkdocs-exclude
mistune
mkdocs-open-in-new-tab
mkdocs-linkcheck
pytest
#mkdocs-print-site-plugin
#mkdocs-plugin-tags
#mkdocs-with-pdf
13 changes: 13 additions & 0 deletions tests/links/test_links.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import pytest
import subprocess
import os

def test_links():
out = 0
try:
out = subprocess.call([os.path.join(os.getcwd(), "links.sh")])
except:
pass

print (out)
assert out == 0