Skip to content

Commit

Permalink
test checks on maintenance versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pharmaverse-bot committed Nov 7, 2023
1 parent d34d1ea commit 40aa7d3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
48 changes: 31 additions & 17 deletions .github/workflows/r-cmd-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,28 +87,42 @@ jobs:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
_R_CHECK_FORCE_SUGGESTS_: false
run: |
script="
description_old <- readLines("DESCRIPTION")
description_dat <- description_old
for (i in seq_along(description_dat)) {
if (grepl("^Version:", description_dat[i])) {
current_version <- sub("^Version: ", "", description_dat[i])
version_parts <- strsplit(current_version, "\\.")[[1]]
# check if maintenance version - if yes, temp update the DESCRIPTION for rcmdchecks
if (length(version_parts) == 4) {
print("Maintenance version detected (format X.Y.Z.M with M >= 9000)")
version_parts <- version_parts[1:3]
}
new_version <- paste(version_parts, collapse = ".")
description_dat[i] <- paste("Version: ", new_version)
}
}
# Write the updated DESCRIPTION file back
writeLines(description_dat, con = description_file_path)
if (!requireNamespace("rcmdcheck", quietly = TRUE)) install.packages("rcmdcheck")
options(crayon.enabled = TRUE)
check_error_on <- '${{ inputs.error-on }}'
if (check_error_on == '') {
check_error_on <- 'note'
check_error_on <- "${{ inputs.error-on }}"
if (check_error_on == "") {
check_error_on <- "note"
}
rcmdcheck::rcmdcheck(
args = c('--no-manual', '--as-cran'),
args = c("--no-manual", "--as-cran"),
error_on = check_error_on,
check_dir = 'check'
)"
if [ ${{ matrix.config.r }} == "devel" ]; then
R -e "install.packages('rcmdcheck')"
fi
echo "$script" > checks.R
Rscript checks.R
check_dir = "check"
)
rm -f checks.R
shell: bash
# Write back initial description file
writeLines(description_dat, con = description_file_path)
shell: Rscript {0}

- name: Upload check results
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: admiralci
Type: Package
Title: ADaM in R Asset Library - CI/CD Workflows
Version: 0.0.1
Version: 0.0.1.9001
Authors@R: c(
person("Open", "Source", email = "[email protected]", role = c("aut", "cre")))
Description: A set of common CI/CD workflows originally designed and developed for
Expand Down

0 comments on commit 40aa7d3

Please sign in to comment.