Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Revise R tests. #8430

Merged
merged 48 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
18d6593
[CI] Revise R tests.
trivialfis Nov 6, 2022
f72695b
typo.
trivialfis Nov 6, 2022
998e012
cleanup.
trivialfis Nov 6, 2022
db8f2f2
cleanup.
trivialfis Nov 6, 2022
9528d91
cleanup.
trivialfis Nov 6, 2022
d3cc638
Message.
trivialfis Nov 6, 2022
f576984
deps.
trivialfis Nov 6, 2022
bbc88b9
Update cache.
trivialfis Nov 6, 2022
8d75aac
format.
trivialfis Nov 6, 2022
f8c7e54
symbol.
trivialfis Nov 6, 2022
82b2f35
doc.
trivialfis Nov 6, 2022
19c766d
Revert "doc."
trivialfis Nov 6, 2022
4ebd738
avoid sh.
trivialfis Nov 6, 2022
a63bd77
Fix.
trivialfis Nov 6, 2022
e84f3e8
sys deps.
trivialfis Nov 6, 2022
9b2bcd4
Fixes.
trivialfis Nov 6, 2022
7aad388
bring back windows test.
trivialfis Nov 6, 2022
2c6acce
check doc.
trivialfis Nov 6, 2022
7d5657a
Check documents.
trivialfis Nov 6, 2022
930cb96
Use github action.
trivialfis Nov 6, 2022
7f072a6
fix.
trivialfis Nov 6, 2022
7b35e1d
extra deps.
trivialfis Nov 6, 2022
5e50a79
checks.
trivialfis Nov 6, 2022
c0ef588
Remove python setup.
trivialfis Nov 6, 2022
7ee5c54
why.
trivialfis Nov 6, 2022
9906160
Revert "why."
trivialfis Nov 6, 2022
683aa72
no sudo.
trivialfis Nov 6, 2022
425063b
root.
trivialfis Nov 6, 2022
c3d0fcf
Fixes
trivialfis Nov 6, 2022
71b0fc5
default test.
trivialfis Nov 7, 2022
fd9dcff
revert.
trivialfis Nov 7, 2022
cb1e2dd
cleanup.
trivialfis Nov 7, 2022
b4573cb
syntax.
trivialfis Nov 7, 2022
0b6c038
cleanup.
trivialfis Nov 7, 2022
e3594ff
fix.
trivialfis Nov 7, 2022
e7db0f0
fix.
trivialfis Nov 7, 2022
09536b1
why.
trivialfis Nov 7, 2022
c5e21c5
run markdown check.
trivialfis Nov 7, 2022
6e00bbf
doc.
trivialfis Nov 7, 2022
8c0a42a
fix.
trivialfis Nov 7, 2022
e7651cb
Fix.
trivialfis Nov 7, 2022
8a997c6
Remove time report.
trivialfis Nov 7, 2022
cbe9ebc
grammar.
trivialfis Nov 8, 2022
91b38b7
Merge branch 'master' into r-checks
trivialfis Nov 8, 2022
a43b9a6
Display isort version.
trivialfis Nov 8, 2022
710c7fc
Merge branch 'master' into r-checks
trivialfis Nov 8, 2022
9e0b746
Use tls instead.
trivialfis Nov 8, 2022
cfd618a
Fix typo.
trivialfis Nov 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
python -m pip install wheel setuptools cpplint pylint
- name: Run lint
run: |
LINT_LANG=cpp make lint
python dmlc-core/scripts/lint.py xgboost cpp R-package/src

sphinx:
runs-on: ubuntu-latest
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/r_nold.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Run R tests with noLD R. Only triggered by a pull request review
# Run expensive R tests with the help of rhub. Only triggered by a pull request review
# See discussion at https://github.com/dmlc/xgboost/pull/6378

name: XGBoost-R-noLD
Expand All @@ -7,9 +7,6 @@ on:
pull_request_review_comment:
types: [created]

env:
R_PACKAGES: c('XML', 'igraph', 'data.table', 'ggplot2', 'DiagrammeR', 'Ckmeans.1d.dp', 'vcd', 'testthat', 'lintr', 'knitr', 'rmarkdown', 'e1071', 'cplm', 'devtools', 'float', 'titanic')

permissions:
contents: read # to fetch code (actions/checkout)

Expand All @@ -18,26 +15,22 @@ jobs:
if: github.event.comment.body == '/gha run r-nold-test' && contains('OWNER,MEMBER,COLLABORATOR', github.event.comment.author_association)
timeout-minutes: 120
runs-on: ubuntu-latest
container: rhub/debian-gcc-devel-nold
container:
image: rhub/debian-gcc-devel-nold
steps:
- name: Install git and system packages
shell: bash
run: |
apt-get update && apt-get install -y git libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev libxml2-dev
apt update && apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev git -y

- uses: actions/checkout@v2
with:
submodules: 'true'

- name: Install dependencies
shell: bash
shell: bash -l {0}
run: |
cat > install_libs.R <<EOT
install.packages(${{ env.R_PACKAGES }},
repos = 'http://cloud.r-project.org',
dependencies = c('Depends', 'Imports', 'LinkingTo'))
EOT
/tmp/R-devel/bin/Rscript install_libs.R
/tmp/R-devel/bin/Rscript -e "source('./R-package/tests/helper_scripts/install_deps.R')"

- name: Run R tests
shell: bash
Expand Down
111 changes: 40 additions & 71 deletions .github/workflows/r_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ name: XGBoost-R-Tests
on: [push, pull_request]

env:
R_PACKAGES: c('XML', 'data.table', 'ggplot2', 'DiagrammeR', 'Ckmeans.1d.dp', 'vcd', 'testthat', 'lintr', 'knitr', 'rmarkdown', 'e1071', 'cplm', 'devtools', 'float', 'titanic')
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
_R_CHECK_EXAMPLE_TIMING_CPU_TO_ELAPSED_THRESHOLD_: 2.5

permissions:
contents: read # to fetch code (actions/checkout)
Expand Down Expand Up @@ -35,29 +33,22 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-5-${{ hashFiles('R-package/DESCRIPTION') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-5-${{ hashFiles('R-package/DESCRIPTION') }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-6-${{ hashFiles('R-package/DESCRIPTION') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-6-${{ hashFiles('R-package/DESCRIPTION') }}

- name: Install dependencies
shell: Rscript {0}
run: |
install.packages(${{ env.R_PACKAGES }},
repos = 'http://cloud.r-project.org',
dependencies = c('Depends', 'Imports', 'LinkingTo'))
- name: Install igraph on Windows
shell: Rscript {0}
if: matrix.config.os == 'windows-latest'
run: |
install.packages('igraph', type='binary')
source("./R-package/tests/helper_scripts/install_deps.R")

- name: Run lintr
run: |
cd R-package
MAKE="make -j$(nproc)" R CMD INSTALL .
MAKEFLAGS="-j$(nproc)" R CMD INSTALL .
# Disable lintr errors for now: https://github.com/dmlc/xgboost/issues/8012
Rscript tests/helper_scripts/run_lint.R || true

test-with-R:
test-R-on-Windows:
runs-on: ${{ matrix.config.os }}
name: Test R on OS ${{ matrix.config.os }}, R ${{ matrix.config.r }}, Compiler ${{ matrix.config.compiler }}, Build ${{ matrix.config.build }}
strategy:
Expand All @@ -66,10 +57,8 @@ jobs:
config:
- {os: windows-latest, r: 'release', compiler: 'mingw', build: 'autotools'}
- {os: windows-latest, r: 'release', compiler: 'msvc', build: 'cmake'}
- {os: windows-latest, r: 'release', compiler: 'mingw', build: 'cmake'}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
_R_CHECK_EXAMPLE_TIMING_CPU_TO_ELAPSED_THRESHOLD_: 2.5
RSPM: ${{ matrix.config.rspm }}

steps:
Expand All @@ -85,80 +74,60 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-5-${{ hashFiles('R-package/DESCRIPTION') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-5-${{ hashFiles('R-package/DESCRIPTION') }}

- name: Install dependencies
shell: Rscript {0}
if: matrix.config.os != 'windows-latest'
run: |
install.packages(${{ env.R_PACKAGES }},
repos = 'http://cloud.r-project.org',
dependencies = c('Depends', 'Imports', 'LinkingTo'))

- name: Install binary dependencies
shell: Rscript {0}
if: matrix.config.os == 'windows-latest'
run: |
install.packages(${{ env.R_PACKAGES }},
type = 'binary',
repos = 'http://cloud.r-project.org',
dependencies = c('Depends', 'Imports', 'LinkingTo'))
key: ${{ runner.os }}-r-${{ matrix.config.r }}-6-${{ hashFiles('R-package/DESCRIPTION') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-6-${{ hashFiles('R-package/DESCRIPTION') }}

- uses: actions/setup-python@v2
with:
python-version: "3.8"
architecture: 'x64'

- uses: r-lib/actions/setup-tinytex@v2

- name: Install dependencies
shell: Rscript {0}
run: |
source("./R-package/tests/helper_scripts/install_deps.R")

- name: Test R
run: |
python tests/ci_build/test_r_package.py --compiler='${{ matrix.config.compiler }}' --build-tool='${{ matrix.config.build }}'
python tests/ci_build/test_r_package.py --compiler='${{ matrix.config.compiler }}' --build-tool="${{ matrix.config.build }}" --task=check

test-R-CRAN:
test-R-on-Debian:
name: Test R package on Debian
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
config:
- {r: 'release'}

env:
_R_CHECK_EXAMPLE_TIMING_CPU_TO_ELAPSED_THRESHOLD_: 2.5
MAKE: "make -j$(nproc)"
container:
image: rhub/debian-gcc-devel

steps:
- name: Install system dependencies
run: |
# Must run before checkout to have the latest git installed.
# No need to add pandoc, the container has it figured out.
apt update && apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev git -y

- uses: actions/checkout@v2
with:
submodules: 'true'

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-tinytex@v2
- name: Install dependencies
shell: bash -l {0}
run: |
/tmp/R-devel/bin/Rscript -e "source('./R-package/tests/helper_scripts/install_deps.R')"

- name: Install system packages
- name: Test R
shell: bash -l {0}
run: |
sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev pandoc pandoc-citeproc libglpk-dev
python3 tests/ci_build/test_r_package.py --r=/tmp/R-devel/bin/R --build-tool=autotools --task=check

- name: Cache R packages
uses: actions/cache@v2
- uses: dorny/paths-filter@v2
id: changes
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-5-${{ hashFiles('R-package/DESCRIPTION') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-5-${{ hashFiles('R-package/DESCRIPTION') }}

- name: Install dependencies
shell: Rscript {0}
run: |
install.packages(${{ env.R_PACKAGES }},
repos = 'http://cloud.r-project.org',
dependencies = c('Depends', 'Imports', 'LinkingTo'))
install.packages('igraph', repos = 'http://cloud.r-project.org', dependencies = c('Depends', 'Imports', 'LinkingTo'))
filters: |
r_package:
- 'R-package/**'

- name: Check R Package
- name: Run document check
if: steps.changes.outputs.r_package == 'true'
run: |
# Print stacktrace upon success of failure
make Rcheck || tests/ci_build/print_r_stacktrace.sh fail
tests/ci_build/print_r_stacktrace.sh success
python3 tests/ci_build/test_r_package.py --r=/tmp/R-devel/bin/R --task=doc
145 changes: 0 additions & 145 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion R-package/demo/runall.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# running all scripts in demo folder
# running all scripts in demo folder, removed during packaging.
demo(basic_walkthrough, package = 'xgboost')
demo(custom_objective, package = 'xgboost')
demo(boost_from_prediction, package = 'xgboost')
Expand Down
Loading