-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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] [R-package] catch builds that have not updated docs #3205
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3cce5d6
[ci] [R-package] catch builds that have not updated docs
jameslamb 3ab3b49
drop reliance on .Renviron
jameslamb 30cac17
remove docs changes
jameslamb 61c103c
Update .ci/test_r_package.sh
jameslamb 0b17315
make all R tasks start with r-package
jameslamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
CRAN_MIRROR="https://cloud.r-project.org/" | ||
R_LIB_PATH=~/Rlib | ||
mkdir -p $R_LIB_PATH | ||
echo "R_LIBS=$R_LIB_PATH" > ${HOME}/.Renviron | ||
export R_LIBS=$R_LIB_PATH | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made a mistake while developing...code with I think we should remove this and use normal environment variables instead, to make the code a little more explicit and easier to reason about. |
||
export PATH="$R_LIB_PATH/R/bin:$PATH" | ||
|
||
# Get details needed for installing R components | ||
|
@@ -90,6 +90,24 @@ 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 == "check-r-docs" ]]; then | ||
Rscript build_r.R | ||
jameslamb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 -E "\.Rd|NAMESPACE" | wc -l | ||
) | ||
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} | ||
Rscript build_r.R --skip-install || exit -1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion to not overcomplicate this
if
statement in the future. Name task with something liker-package-check-docs
and then just check that it starts withr-package
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh good idea! Just pushed 0b17315 to implement this