"src/git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "429148309a7912754b89dfda78f01f39df17be3f"
Unverified Commit eb9bbfb3 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[ci] Move check-docs and lint jobs off Travis (#3726)



* [ci] Move check-docs and lint jobs off Travis

* Apply suggestions from code review
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>

* try moving check-docs into a containerized job

* add install flag and README badge

* trying to find the error

* ignore pipefail

* remove -e

* Apply suggestions from code review
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>

* more changes

* additional changes

* Update .github/workflows/static_analysis.yml

* Update README.md
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>

* move constants
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>
parent ed4d0ae3
......@@ -48,7 +48,7 @@ else # Linux
fi
fi
if [[ "${TASK:0:9}" != "r-package" ]]; then
if [[ "${TASK}" != "r-package" ]]; then
if [[ $SETUP_CONDA != "false" ]]; then
sh conda.sh -b -p $CONDA
fi
......
......@@ -8,7 +8,7 @@ elif [[ $OS_NAME == "linux" ]] && [[ $COMPILER == "clang" ]]; then
export CC=clang
fi
if [[ "${TASK:0:9}" == "r-package" ]]; then
if [[ "${TASK}" == "r-package" ]]; then
bash ${BUILD_DIRECTORY}/.ci/test_r_package.sh || exit -1
exit 0
fi
......
......@@ -105,24 +105,6 @@ if [[ $OS_NAME == "macos" ]]; then
fi
Rscript --vanilla -e "install.packages(${packages}, repos = '${CRAN_MIRROR}', lib = '${R_LIB_PATH}', dependencies = c('Depends', 'Imports', 'LinkingTo'))" || exit -1
if [[ $TASK == "r-package-check-docs" ]]; then
Rscript build_r.R || exit -1
Rscript --vanilla -e "install.packages('roxygen2', repos = '${CRAN_MIRROR}', lib = '${R_LIB_PATH}', dependencies = c('Depends', 'Imports', 'LinkingTo'))" || exit -1
Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit -1
num_doc_files_changed=$(
git diff --name-only | grep --count -E "\.Rd|NAMESPACE"
)
if [[ ${num_doc_files_changed} -gt 0 ]]; then
echo "Some R documentation files have changed. Please re-generate them and commit those changes."
echo ""
echo " Rscript build_r.R"
echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\""
echo ""
exit -1
fi
exit 0
fi
cd ${BUILD_DIRECTORY}
PKG_TARBALL="lightgbm_*.tar.gz"
......
name: R GitHub Actions
name: R-package
on:
push:
......@@ -40,11 +40,6 @@ jobs:
compiler: clang
r_version: 4.0
build_type: cmake
- os: ubuntu-latest
task: r-package-check-docs
compiler: gcc
r_version: 4.0
build_type: cmake
- os: macOS-latest
task: r-package
compiler: gcc
......
# contains non-functional tests, like checks on docs
# and code style
name: Static Analysis
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
COMPILER: 'gcc'
CONDA_ENV: test-env
GITHUB_ACTIONS: 'true'
OS_NAME: 'linux'
PYTHON_VERSION: 3.8
jobs:
test:
name: ${{ matrix.task }}
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- task: lint
- task: check-docs
steps:
- name: Checkout repository
uses: actions/checkout@v2.3.4
with:
fetch-depth: 5
submodules: false
- name: Setup and run tests
shell: bash
run: |
export TASK="${{ matrix.task }}"
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
r-check-docs:
name: r-package-check-docs
timeout-minutes: 60
runs-on: ubuntu-latest
container: rocker/verse
steps:
- name: Checkout repository
uses: actions/checkout@v2.3.4
with:
fetch-depth: 5
submodules: true
- name: Install packages
shell: bash
run: |
Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'roxygen2', 'testthat'), repos = 'https://cran.r-project.org')"
sh build-cran-package.sh || exit -1
R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit -1
- name: Test documentation
shell: bash --noprofile --norc {0}
run: |
Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit -1
num_doc_files_changed=$(
git diff --name-only | grep --count -E "\.Rd|NAMESPACE"
)
if [[ ${num_doc_files_changed} -gt 0 ]]; then
echo "Some R documentation files have changed. Please re-generate them and commit those changes."
echo ""
echo " sh build-cran-package.sh"
echo " R CMD INSTALL --with-keep.source lightgbm_*.tar.gz"
echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\""
echo ""
exit -1
fi
all-successful:
# https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert
runs-on: ubuntu-latest
needs: [test, r-check-docs]
steps:
- name: Note that all tests succeeded
run: echo "🎉"
......@@ -20,8 +20,6 @@ env:
- TASK=sdist
- TASK=bdist
- TASK=if-else
- TASK=lint
- TASK=check-docs
- TASK=mpi METHOD=source
- TASK=mpi METHOD=pip PYTHON_VERSION=3.7
- TASK=mpi METHOD=wheel PYTHON_VERSION=3.7
......@@ -37,10 +35,6 @@ matrix:
env: TASK=gpu METHOD=pip PYTHON_VERSION=3.6
- os: osx
env: TASK=gpu METHOD=wheel PYTHON_VERSION=3.7
- os: osx
env: TASK=lint
- os: osx
env: TASK=check-docs
before_install:
- test -n $CC && unset CC
......
......@@ -3,7 +3,8 @@
Light Gradient Boosting Machine
===============================
[![GitHub Actions Build Status](https://github.com/microsoft/LightGBM/workflows/R%20GitHub%20Actions/badge.svg?branch=master)](https://github.com/microsoft/LightGBM/actions)
[![R-package GitHub Actions Build Status](https://github.com/microsoft/LightGBM/workflows/R-package/badge.svg?branch=master)](https://github.com/microsoft/LightGBM/actions)
[![Static Analysis GitHub Actions Build Status](https://github.com/microsoft/LightGBM/workflows/Static%20Analysis/badge.svg?branch=master)](https://github.com/microsoft/LightGBM/actions)
[![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)
[![Travis Build Status](https://travis-ci.org/microsoft/LightGBM.svg?branch=master)](https://travis-ci.org/microsoft/LightGBM)
......
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