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

WIP: [ci] [R-package] add a CI job to run R reverse dependency checks #6734

Draft
wants to merge 34 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
855632f
add a CI job to run reverse dependency checks
jameslamb Nov 28, 2024
df15521
Merge branch 'master' into r/revdepcheck
jameslamb Dec 2, 2024
cb443cf
update .gitignore
jameslamb Dec 2, 2024
07592ab
remove CI
jameslamb Dec 2, 2024
677f7ea
remove even more CI
jameslamb Dec 2, 2024
79d9472
actions name
jameslamb Dec 2, 2024
58fe697
run on pushes
jameslamb Dec 2, 2024
f37157a
even more event triggers
jameslamb Dec 2, 2024
db4d44f
remove unnecessary workflows
jameslamb Dec 2, 2024
974a206
install build dependencies
jameslamb Dec 2, 2024
d031220
install more dependencies
jameslamb Dec 2, 2024
02b83e5
avoid errors in vignettes, install packages from source
jameslamb Dec 2, 2024
61090eb
use r-release so we get binary packages
jameslamb Dec 2, 2024
321ce3c
trying pre-installing deps
jameslamb Dec 2, 2024
a43cb3a
try pre-installing to speed this up
jameslamb Dec 2, 2024
fc5d295
try doing more binary installs upfront
jameslamb Dec 2, 2024
550cd39
more parallelism, install more stuff
jameslamb Dec 3, 2024
319cc9b
update PATH
jameslamb Dec 3, 2024
5d2d651
more parallelization in crandep install, try to make it pass
jameslamb Dec 3, 2024
2529a3d
set _R_CHECK_LIMIT_CORES_
jameslamb Dec 3, 2024
c1e1515
trying stuff
jameslamb Dec 8, 2024
65896f6
more cleanup
jameslamb Dec 9, 2024
791bd3a
more changes, better docs
jameslamb Dec 9, 2024
679f1fa
Merge branch 'master' into r/revdepcheck
jameslamb Dec 9, 2024
a898f02
fix argument-passing
jameslamb Dec 9, 2024
7e46453
pre-install crandep
jameslamb Dec 9, 2024
98a5f10
try 2 checks at a time
jameslamb Dec 10, 2024
83a145f
try one at a time to see timings
jameslamb Dec 10, 2024
ddd1a02
do not fail on failures
jameslamb Dec 10, 2024
4fd89e2
skip qeML vignettes
jameslamb Dec 10, 2024
56eecc2
one more try skipping vignettes
jameslamb Dec 10, 2024
912de94
try fully skipping qeML
jameslamb Dec 11, 2024
8e68d97
keep packages installed, some of them depend on each other
jameslamb Dec 11, 2024
a70ce5e
skip qeML too
jameslamb Dec 12, 2024
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
Prev Previous commit
Next Next commit
remove unnecessary workflows
  • Loading branch information
jameslamb committed Dec 2, 2024
commit db4d44f294db7047b994f7533283c2f410c54450
138 changes: 2 additions & 136 deletions .github/workflows/r_revdepchecks.yml
Original file line number Diff line number Diff line change
@@ -71,144 +71,10 @@ jobs:
$env:COMPILER = "${{ matrix.compiler }}"
$env:TASK = "${{ matrix.task }}"
& "$env:GITHUB_WORKSPACE/.ci/test-windows.ps1"
test-r-sanitizers:
name: r-sanitizers (ubuntu-latest, R-devel, ${{ matrix.compiler }} ASAN/UBSAN)
timeout-minutes: 60
runs-on: ubuntu-latest
container: wch1/r-debug
strategy:
fail-fast: false
matrix:
include:
- r_customization: san
compiler: gcc
- r_customization: csan
compiler: clang
steps:
- name: Trust git cloning LightGBM
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 5
submodules: true
- name: Install packages
shell: bash
run: |
RDscript${{ matrix.r_customization }} -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
sh build-cran-package.sh --r-executable=RD${{ matrix.r_customization }}
RD${{ matrix.r_customization }} CMD INSTALL lightgbm_*.tar.gz || exit 1
- name: Run tests with sanitizers
shell: bash
run: |
cd R-package/tests
exit_code=0
RDscript${{ matrix.r_customization }} testthat.R >> tests.log 2>&1 || exit_code=-1
cat ./tests.log
exit ${exit_code}
test-r-extra-checks:
name: r-package (${{ matrix.image }}, R-devel)
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
# references:
# * CRAN "additional checks": https://cran.r-project.org/web/checks/check_issue_kinds.html
# * images: https://r-hub.github.io/containers/containers.html
image:
- clang16
- clang17
- clang18
- clang19
- gcc14
- intel
- rchk
runs-on: ubuntu-latest
container: ghcr.io/r-hub/containers/${{ matrix.image }}:latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 5
submodules: true
- name: Install pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Install LaTeX
shell: bash
run: |
if type -f apt 2>&1 > /dev/null; then
apt-get update
apt-get install --no-install-recommends -y \
devscripts \
texinfo \
texlive-latex-extra \
texlive-latex-recommended \
texlive-fonts-recommended \
texlive-fonts-extra \
tidy \
qpdf
else
yum update -y
yum install -y \
devscripts \
qpdf \
texinfo \
texinfo-tex \
texlive-latex \
tidy
fi
- name: Install packages and run tests
shell: bash
run: |
Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"
sh build-cran-package.sh

# 'rchk' isn't run through 'R CMD check', use the approach documented at
# https://r-hub.github.io/containers/local.html
if [[ "${{ matrix.image }}" =~ "rchk" ]]; then
r-check "$(pwd)" \
| tee ./rchk-logs.txt 2>&1

# the '-v' exceptions below are from R/rchk itself and not LightGBM:
# https://github.com/kalibera/rchk/issues/22#issuecomment-656036156
if grep -E '\[PB\]|ERROR' ./rchk-logs.txt \
| grep -v 'too many states' \
> /dev/null; \
then
echo "rchk found issues"
exit 1
else
echo "rchk did not find any issues"
exit 0
fi
fi

# 'testthat' is not needed by 'rchk', so avoid installing it until here
Rscript -e "install.packages('testthat', repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())"

if [[ "${{ matrix.image }}" =~ "clang" ]]; then
# allowing the following NOTEs (produced by default in the clang images):
#
# * checking compilation flags used ... NOTE
# Compilation used the following non-portable flag(s):
# ‘-Wp,-D_FORTIFY_SOURCE=3’
#
# even though CRAN itself sets that:
# https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-clang
#
declare -i allowed_notes=1
else
declare -i allowed_notes=0
fi

bash .ci/run-r-cmd-check.sh \
"$(echo lightgbm_$(head -1 VERSION.txt).tar.gz)" \
"${allowed_notes}"
all-r-package-jobs-successful:
all-r-revdepchecks-jobs-successful:
if: always()
runs-on: ubuntu-latest
needs: [test, test-r-sanitizers, test-r-extra-checks]
needs: [test]
steps:
- name: Note that all tests succeeded
uses: re-actors/alls-green@v1.2.2
Loading
Oops, something went wrong.