diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 19c786a..7b8162b 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -12,17 +12,11 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Node - uses: actions/setup-node@v1 - with: - node-version: '16' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r tests-requirements.txt pip install -r requirements.txt - npm install -g remark-cli remark-validate-links - npm install -g markdown-link-check - name: Run sequential tests run: | ./tests.sh diff --git a/test-doc.sh b/test-doc.sh index f5c51c2..898b2a4 100755 --- a/test-doc.sh +++ b/test-doc.sh @@ -2,18 +2,34 @@ # author: deadc0de6 (https://github.com/deadc0de6) # Copyright (c) 2022, deadc0de6 -## test the doc with remark -## https://github.com/remarkjs/remark-validate-links +## test the doc with linkcheckMarkdown +## pip install --user linkcheckmd set +e -which remark >/dev/null 2>&1 +which linkcheckMarkdown >/dev/null 2>&1 r="$?" set -e if [ "$r" != "0" ]; then - echo "[WARNING] install \"remark\" to test the doc" -else - remark -f -u validate-links docs/ - remark -f -u validate-links *.md + echo "[ERROR] install \"linkcheckMarkdown\" to test for dead links" + exit 1 fi +find . -type f -iname '*.md' | while read line; do + echo "checking links in \"${line}\"" + linkcheckMarkdown ${line} +done + + +### test the doc with remark +### https://github.com/remarkjs/remark-validate-links +#set +e +#which remark >/dev/null 2>&1 +#r="$?" +#set -e +#if [ "$r" != "0" ]; then +# echo "[WARNING] install \"remark\" to test the doc" +#else +# remark -f -u validate-links docs/ +# remark -f -u validate-links *.md +#fi ### test the doc with markdown-link-check ### https://github.com/tcort/markdown-link-check diff --git a/tests-requirements.txt b/tests-requirements.txt index b1f2e91..65e131d 100644 --- a/tests-requirements.txt +++ b/tests-requirements.txt @@ -5,4 +5,5 @@ coveralls; python_version > '3.5' pyflakes; python_version > '3.5' pylint; python_version > '3.5' halo; python_version > '3.5' -distro; python_version > '3.5' \ No newline at end of file +distro; python_version > '3.5' +linkcheckmd; python_version > '3.5' \ No newline at end of file