Skip to content

Commit

Permalink
Merge branch 'master' into docs/jlamb
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Feb 2, 2021
2 parents dd3cfe0 + 56fc036 commit e951669
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,23 @@ source activate $CONDA_ENV

cd $BUILD_DIRECTORY

if [[ $TASK == "check-docs" ]]; then
if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
cd $BUILD_DIRECTORY/docs
conda install -q -y -n $CONDA_ENV -c conda-forge doxygen
pip install --user -r requirements.txt linkchecker rstcheck
pip install --user -r requirements.txt rstcheck
# check reStructuredText formatting
cd $BUILD_DIRECTORY/python-package
rstcheck --report warning `find . -type f -name "*.rst"` || exit -1
cd $BUILD_DIRECTORY/docs
rstcheck --report warning --ignore-directives=autoclass,autofunction,doxygenfile `find . -type f -name "*.rst"` || exit -1
# build docs and check them for broken links
# build docs
make html || exit -1
linkchecker --config=.linkcheckerrc ./_build/html/*.html || exit -1
if [[ $TASK == "check-links" ]]; then
# check docs for broken links
pip install --user linkchecker
linkchecker --config=.linkcheckerrc ./_build/html/*.html || exit -1
exit 0
fi
# check the consistency of parameters' descriptions and other stuff
cp $BUILD_DIRECTORY/docs/Parameters.rst $BUILD_DIRECTORY/docs/Parameters-backup.rst
cp $BUILD_DIRECTORY/src/io/config_auto.cpp $BUILD_DIRECTORY/src/io/config_auto-backup.cpp
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/linkchecker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Link checks

on:
# Run manually by clicking a button in the UI
workflow_dispatch:
# Run once a day at 8:00am UTC
schedule:
- cron: '0 8 * * *'

env:
CONDA_ENV: test-env
GITHUB_ACTIONS: 'true'
OS_NAME: 'linux'
PYTHON_VERSION: 3.9
TASK: 'check-links'

jobs:
check-links:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2.3.4
with:
fetch-depth: 5
submodules: false
- name: Check that all tests succeeded
run: |
export BUILD_DIRECTORY="$GITHUB_WORKSPACE"
export CONDA=${HOME}/miniconda
export PATH=${CONDA}/bin:${HOME}/.local/bin:${PATH}
$GITHUB_WORKSPACE/.ci/setup.sh || exit -1
$GITHUB_WORKSPACE/.ci/test.sh || exit -1
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Light Gradient Boosting Machine
[![Azure Pipelines Build Status](https://lightgbm-ci.visualstudio.com/lightgbm-ci/_apis/build/status/Microsoft.LightGBM?branchName=master)](https://lightgbm-ci.visualstudio.com/lightgbm-ci/_build/latest?definitionId=1)
[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/1ys5ot401m0fep6l/branch/master?svg=true)](https://ci.appveyor.com/project/guolinke/lightgbm/branch/master)
[![Documentation Status](https://readthedocs.org/projects/lightgbm/badge/?version=latest)](https://lightgbm.readthedocs.io/)
![Link checks](https://github.com/microsoft/LightGBM/workflows/Link%20checks/badge.svg)
[![License](https://img.shields.io/github/license/microsoft/lightgbm.svg)](https://github.com/microsoft/LightGBM/blob/master/LICENSE)
[![Python Versions](https://img.shields.io/pypi/pyversions/lightgbm.svg?logo=python&logoColor=white)](https://pypi.org/project/lightgbm)
[![PyPI Version](https://img.shields.io/pypi/v/lightgbm.svg?logo=pypi&logoColor=white)](https://pypi.org/project/lightgbm)
Expand Down
1 change: 1 addition & 0 deletions docs/.linkcheckerrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ maxrequestspersecond=1
recursionlevel=1
anchors=1
sslverify=0
threads=1

[filtering]
ignore=
Expand Down

0 comments on commit e951669

Please sign in to comment.