Skip to content

Commit

Permalink
Combine deps install step (#6260)
Browse files Browse the repository at this point in the history
* Combine deps install step

* try again tomorrow
  • Loading branch information
MichaelChirico authored Jul 14, 2024
1 parent b9f0211 commit bbe7563
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions .github/workflows/R-CMD-check-occasional.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
schedule:
- cron: '17 13 13 * *' # 13th of month at 13:17 UTC
- cron: '17 13 14 * *' # 14th of month at 13:17 UTC

# A more complete suite of checks to run monthly; each PR/merge need not pass all these, but they should pass before CRAN release
name: R-CMD-check-occasional
Expand Down Expand Up @@ -42,7 +42,6 @@ jobs:
r: '4.1'

env:
R_LIBS_USER: /home/runner/work/r-lib
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -95,16 +94,6 @@ jobs:
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies=TRUE, force=TRUE)
other_deps_expr = parse('inst/tests/other.Rraw', n=1L)
eval(other_deps_expr)
pkgs <- get(as.character(other_deps_expr[[1L]][[2L]]))
# May not install on oldest R versions
try(remotes::install_cran(c(pkgs, "rcmdcheck"), force=TRUE))
shell: Rscript {0}

- name: Check
env:
# several Suggests dependencies have R dependencies more recent than ours
Expand All @@ -114,22 +103,26 @@ jobs:
run: |
options(crayon.enabled = TRUE)
remotes::install_deps(dependencies=TRUE, force=TRUE)
other_deps_expr = parse('inst/tests/other.Rraw', n=1L)
eval(other_deps_expr)
pkgs <- get(as.character(other_deps_expr[[1L]][[2L]]))
# Many will not install on oldest R versions
try(remotes::install_cran(c(pkgs, "rcmdcheck"), force=TRUE))
# we define this in data.table namespace, but it appears to be exec
if (!exists("isFALSE", "package:base")) {
if (!exists("isFALSE", asNamespace("data.table"))) {
cat("isFALSE not found in base, but data.table did not define it either!\n")
message("isFALSE not found in base, but data.table did not define it either!\n")
}
# attempt defining it here as a workaround...
isFALSE = function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x
}
other_deps_expr = parse('inst/tests/other.Rraw', n=1L)
eval(other_deps_expr)
pkgs = get(as.character(other_deps_expr[[1L]][[2L]]))
has_pkg = sapply(pkgs, requireNamespace, quietly=TRUE)
run_other = all(has_pkg)
if (!run_other) {
cat(sprintf("Skipping other.Rraw since some required packages are not available: %s\n", toString(pkgs[!has_pkg])))
message(sprintf("Skipping other.Rraw since some required packages are not available: %s\n", toString(pkgs[!has_pkg])))
}
Sys.setenv(TEST_DATA_TABLE_WITH_OTHER_PACKAGES=as.character(run_other))
Expand Down

0 comments on commit bbe7563

Please sign in to comment.