Unverified Commit 1c18ad32 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[ci] move link checking to a cron job (#3890)

* [ci] move link checking to a cron job

* run once to register

* set PYTHON_VERSION

* actually build docs

* uncomment

* remove stuff

* Update docs/.linkcheckerrc

* condense

* remove PR triggers again

* Update .github/workflows/linkchecker.yml

* move TASK
parent a4cae37c
...@@ -18,7 +18,7 @@ source activate $CONDA_ENV ...@@ -18,7 +18,7 @@ source activate $CONDA_ENV
cd $BUILD_DIRECTORY cd $BUILD_DIRECTORY
if [[ $TASK == "check-docs" ]]; then if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
cd $BUILD_DIRECTORY/docs cd $BUILD_DIRECTORY/docs
conda install -q -y -n $CONDA_ENV -c conda-forge doxygen 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 linkchecker rstcheck
...@@ -27,9 +27,13 @@ if [[ $TASK == "check-docs" ]]; then ...@@ -27,9 +27,13 @@ if [[ $TASK == "check-docs" ]]; then
rstcheck --report warning `find . -type f -name "*.rst"` || exit -1 rstcheck --report warning `find . -type f -name "*.rst"` || exit -1
cd $BUILD_DIRECTORY/docs cd $BUILD_DIRECTORY/docs
rstcheck --report warning --ignore-directives=autoclass,autofunction,doxygenfile `find . -type f -name "*.rst"` || exit -1 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 make html || exit -1
linkchecker --config=.linkcheckerrc ./_build/html/*.html || exit -1 if [[ $TASK == "check-links" ]]; then
# check docs for broken links
linkchecker --config=.linkcheckerrc ./_build/html/*.html || exit -1
exit 0
fi
# check the consistency of parameters' descriptions and other stuff # check the consistency of parameters' descriptions and other stuff
cp $BUILD_DIRECTORY/docs/Parameters.rst $BUILD_DIRECTORY/docs/Parameters-backup.rst 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 cp $BUILD_DIRECTORY/src/io/config_auto.cpp $BUILD_DIRECTORY/src/io/config_auto-backup.cpp
......
name: Link checks
on:
# Run manually by clicking a button in the UI
workflow_dispatch:
# Run every 8 hours
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
...@@ -10,6 +10,7 @@ Light Gradient Boosting Machine ...@@ -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) [![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) [![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/) [![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) [![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) [![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) [![PyPI Version](https://img.shields.io/pypi/v/lightgbm.svg?logo=pypi&logoColor=white)](https://pypi.org/project/lightgbm)
......
...@@ -3,6 +3,7 @@ maxrequestspersecond=1 ...@@ -3,6 +3,7 @@ maxrequestspersecond=1
recursionlevel=1 recursionlevel=1
anchors=1 anchors=1
sslverify=0 sslverify=0
threads=1
[filtering] [filtering]
ignore= ignore=
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment