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 23 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
47 changes: 0 additions & 47 deletions .github/workflows/r_nold.yml

This file was deleted.

74 changes: 74 additions & 0 deletions .github/workflows/r_rhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 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-Rhub

on:
pull_request_review_comment:
trivialfis marked this conversation as resolved.
Show resolved Hide resolved
types: [created]

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

jobs:
test-Rhub-noLD:
if: github.event.comment.body == '/gha run rhub-test' && contains('OWNER,MEMBER,COLLABORATOR', github.event.comment.author_association)
timeout-minutes: 120
runs-on: ubuntu-latest
container: rhub/debian-gcc-devel-nold
steps:
- name: Install git and system packages
shell: bash
run: |
sudo apt update && sudo apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev pandoc pandoc-citeproc libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev git -y

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

- name: Install dependencies
shell: bash -l {0}
run: |
/tmp/R-devel/bin/Rscript -e "source('./R-package/tests/helper_scripts/install_deps.R')"


- name: Run R tests
shell: bash
run: |
cd R-package && \
/tmp/R-devel/bin/R CMD INSTALL . && \
/tmp/R-devel/bin/R -q -e "library(testthat); setwd('tests'); source('testthat.R')"

test-Rhub-debian:
if: github.event.comment.body == '/gha run rhub-test' && contains('OWNER,MEMBER,COLLABORATOR', github.event.comment.author_association)
timeout-minutes: 120
runs-on: ubuntu-latest
container: rhub/debian-gcc-devel

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

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

- name: Install system dependencies
run: |
sudo apt update && sudo apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev pandoc pandoc-citeproc libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev git -y

- name: Install dependencies
shell: bash -l {0}
run: |
/tmp/R-devel/bin/Rscript -e "source('./R-package/tests/helper_scripts/install_deps.R')"

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

- name: Build R
shell: bash -l {0}
run: |
python tests/ci_build/test_r_package.py --r=/tmp/R-devel/bin/R --compiler=mingw --build-tool=autotools --task=check
102 changes: 31 additions & 71 deletions .github/workflows/r_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ 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 }}

permissions:
Expand Down Expand Up @@ -34,25 +33,23 @@ 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') }}

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

- 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

Expand All @@ -65,7 +62,7 @@ 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'}
- {os: ubuntu-latest, r: 'release', compiler: 'mingw', build: 'autotools'}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
Expand All @@ -83,76 +80,39 @@ 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'

- name: Test R
- name: Install system dependencies
if: matrix.config.os != 'windows-latest'
run: |
python tests/ci_build/test_r_package.py --compiler='${{ matrix.config.compiler }}' --build-tool='${{ matrix.config.build }}'

test-R-CRAN:
runs-on: ubuntu-latest

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

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

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
sudo apt update && sudo apt install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev pandoc pandoc-citeproc libglpk-dev libxml2-dev libharfbuzz-dev libfribidi-dev git -y

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

- name: Install system packages
run: |
sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev libssh2-1-dev libgit2-dev pandoc pandoc-citeproc libglpk-dev

- name: Cache R packages
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}
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'))
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 }}" --task=check


- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
r_package:
- 'R-package/**'

- name: Check R Package
- name: Run document check
if: steps.changes.outputs.r_package == 'true' && matrix.config.os != 'windows-latest'
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
python tests/ci_build/test_r_package.py --compiler='${{ matrix.config.compiler }}' --build-tool="${{ matrix.config.build }}" --task=doc
Loading