test-docs.sh 637 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

set -e -E -u -o pipefail

conda env create \
    --name test-env \
    --file ./docs/env.yml \
|| exit 1

# shellcheck disable=SC1091
source activate test-env

# build docs
make -C docs html || exit 1

if [[ $TASK == "check-links" ]]; then
    # check docs for broken links
18
19
20
21
22
23
24
25
26
27
28
    conda install -y -n test-env 'lychee>=0.20.1'
    # to see all gained files add "--dump-inputs" flag
    # to see all gained links add "--dump" flag
    lychee \
        "--config=./docs/.lychee.toml" \
        "--" \
        "**/*.rst" \
        "**/*.md" \
        "./R-package/**/*.Rd" \
        "./docs/_build/html/*.html" \
    || exit 1
29
fi