diff --git a/.github/workflows/test-doc.yml b/.github/workflows/test-doc.yml index cc77d14..cfc3e30 100644 --- a/.github/workflows/test-doc.yml +++ b/.github/workflows/test-doc.yml @@ -19,6 +19,6 @@ jobs: python -m pip install --upgrade pip pip install -r tests-requirements.txt npm install -g remark-cli remark-validate-links - - name: Run with 1 worker + - name: Check the doc run: | ./scripts/check-doc.sh diff --git a/scripts/check-doc.sh b/scripts/check-doc.sh index bb72a9f..acdeecf 100755 --- a/scripts/check-doc.sh +++ b/scripts/check-doc.sh @@ -12,17 +12,17 @@ find . -type f -iname '*.md' | while read -r line; do ./scripts/check_links.py "${line}" done -## test the doc internal links -## https://github.com/remarkjs/remark-validate-links -## https://github.com/tcort/markdown-link-check -## npm install -g remark-cli remark-validate-links -if ! which remark >/dev/null 2>&1; then - echo "[WARNING] install \"remark\" to test the doc" - exit 1 -fi - -in_cicd="${GH_WORKFLOW:-}" +in_cicd="${GITHUB_WORKFLOW:-}" if [ -n "${in_cicd}" ]; then + ## test the doc internal links when in CI/CD + ## https://github.com/remarkjs/remark-validate-links + ## https://github.com/tcort/markdown-link-check + ## npm install -g remark-cli remark-validate-links + if ! which remark >/dev/null 2>&1; then + echo "[WARNING] install \"remark\" to test the doc" + exit 1 + fi + echo "------------------------" echo "checking internal links" find . -type f -iname '*.md' | while read -r line; do diff --git a/tests.sh b/tests.sh index 3a793f3..330a8db 100755 --- a/tests.sh +++ b/tests.sh @@ -6,10 +6,10 @@ set -eu -o errtrace -o pipefail cur=$(cd "$(dirname "${0}")" && pwd) -in_cicd="${GH_WORKFLOW:-}" +in_cicd="${GITHUB_WORKFLOW:-}" -# patch TERM var in ci/cd if [ -n "${in_cicd}" ]; then + # patch TERM var in ci/cd if [ -z "${TERM}" ]; then export TERM="linux" fi