From 90061f78feec9491f77a16e3d96a7366c6c8e5bf Mon Sep 17 00:00:00 2001 From: Philipp Baumann Date: Fri, 2 Feb 2024 13:11:06 +0100 Subject: [PATCH 1/7] update tests --- DESCRIPTION | 2 +- R/rix.R | 21 +++++--- dev/flat_nix_build.Rmd | 3 +- dev/flat_rix.Rmd | 28 +++++++---- dev/flat_with_nix.Rmd | 20 ++++---- inst/extdata/default.nix | 49 ++++++++++++------- man/rix.Rd | 21 +++++--- tests/testthat/_snaps/rix/code_default.nix | 2 +- .../testthat/_snaps/rix/no_quarto_default.nix | 2 +- tests/testthat/_snaps/rix/other_default.nix | 2 +- tests/testthat/_snaps/rix/rstudio_default.nix | 2 +- .../_snaps/rix/yes_quarto_default.nix | 2 +- tests/testthat/test-nix_build.R | 3 +- tests/testthat/test-rix.R | 7 ++- tests/testthat/test-with_nix.R | 20 ++++---- 15 files changed, 109 insertions(+), 75 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9fac4778..59f5ace0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -31,4 +31,4 @@ Config/testthat/edition: 3 Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 diff --git a/R/rix.R b/R/rix.R index 79c5d97a..c4dbd7c4 100644 --- a/R/rix.R +++ b/R/rix.R @@ -19,15 +19,19 @@ #' interactively use "rstudio" or "code" for Visual Studio Code. For other editors, #' use "other". This has been tested with RStudio, VS Code and Emacs. If other #' editors don't work, please open an issue. -#' @param project_path Character, defaults to the current working directory. Where to write -#' `default.nix`, for example "/home/path/to/project". -#' The file will thus be written to the file "/home/path/to/project/default.nix". +#' @param project_path Character, defaults to the current working directory. +#' Where to write `default.nix`, for example "/home/path/to/project". +#' The file will thus be written to the file +#' "/home/path/to/project/default.nix". #' @param overwrite Logical, defaults to FALSE. If TRUE, overwrite the `default.nix` #' file in the specified path. #' @param print Logical, defaults to FALSE. If TRUE, print `default.nix` to console. -#' @param shell_hook Character, defaults to `"R --vanilla"`. Commands added to the shell_hook get -#' executed when the Nix shell starts (via `shellHook`). So by default, using `nix-shell default.nix` will -#' start R. Set to NULL if you want bash to be started instead. +#' @param shell_hook Character of length 1, defaults to `NULL`. Commands added +#' to the `shellHook` variable executed when the Nix shell starts. So +#' by default, using `nix-shell default.nix` (or path with `shell.nix`) will +#' start a specific program, possibly with flags (separated by space), and/or +#' do shell actions. You can for example use `shell_hook = R`, if you want to +#' directly enter the declared Nix R session. #' @details This function will write a `default.nix` in the chosen path. Using #' the Nix package manager, it is then possible to build a reproducible #' development environment using the `nix-build` command in the path. This @@ -75,7 +79,8 @@ #' ide = "code", #' project_path = path_default_nix, #' overwrite = TRUE, -#' print = TRUE) +#' print = TRUE, +#' shell_hook = NULL) #' } rix <- function(r_ver = "latest", r_pkgs = NULL, @@ -86,7 +91,7 @@ rix <- function(r_ver = "latest", project_path = ".", overwrite = FALSE, print = FALSE, - shell_hook = "R --vanilla"){ + shell_hook = NULL){ stopifnot("'ide' has to be one of 'other', 'rstudio' or 'code'" = (ide %in% c("other", "rstudio", "code"))) diff --git a/dev/flat_nix_build.Rmd b/dev/flat_nix_build.Rmd index b0d35cce..fec8d0fa 100644 --- a/dev/flat_nix_build.Rmd +++ b/dev/flat_nix_build.Rmd @@ -241,7 +241,8 @@ testthat::test_that("Testing that `nix_build()` builds derivation", { rix( r_ver = "latest", overwrite = TRUE, - project_path = path_subshell + project_path = path_subshell, + shell_hook = NULL ) out <- nix_build( diff --git a/dev/flat_rix.Rmd b/dev/flat_rix.Rmd index fafae199..35a5fb51 100644 --- a/dev/flat_rix.Rmd +++ b/dev/flat_rix.Rmd @@ -35,15 +35,19 @@ you use another IDE, you can leave the "ide" argument blank: #' interactively use "rstudio" or "code" for Visual Studio Code. For other editors, #' use "other". This has been tested with RStudio, VS Code and Emacs. If other #' editors don't work, please open an issue. -#' @param project_path Character, defaults to the current working directory. Where to write -#' `default.nix`, for example "/home/path/to/project". -#' The file will thus be written to the file "/home/path/to/project/default.nix". +#' @param project_path Character, defaults to the current working directory. +#' Where to write `default.nix`, for example "/home/path/to/project". +#' The file will thus be written to the file +#' "/home/path/to/project/default.nix". #' @param overwrite Logical, defaults to FALSE. If TRUE, overwrite the `default.nix` #' file in the specified path. #' @param print Logical, defaults to FALSE. If TRUE, print `default.nix` to console. -#' @param shell_hook Character, defaults to `"R --vanilla"`. Commands added to the shell_hook get -#' executed when the Nix shell starts (via `shellHook`). So by default, using `nix-shell default.nix` will -#' start R. Set to NULL if you want bash to be started instead. +#' @param shell_hook Character of length 1, defaults to `NULL`. Commands added +#' to the `shellHook` variable executed when the Nix shell starts. So +#' by default, using `nix-shell default.nix` (or path with `shell.nix`) will +#' start a specific program, possibly with flags (separated by space), and/or +#' do shell actions. You can for example use `shell_hook = R`, if you want to +#' directly enter the declared Nix R session. #' @details This function will write a `default.nix` in the chosen path. Using #' the Nix package manager, it is then possible to build a reproducible #' development environment using the `nix-build` command in the path. This @@ -91,7 +95,8 @@ you use another IDE, you can leave the "ide" argument blank: #' ide = "code", #' project_path = path_default_nix, #' overwrite = TRUE, -#' print = TRUE) +#' print = TRUE, +#' shell_hook = NULL) #' } rix <- function(r_ver = "latest", r_pkgs = NULL, @@ -102,7 +107,7 @@ rix <- function(r_ver = "latest", project_path = ".", overwrite = FALSE, print = FALSE, - shell_hook = "R --vanilla"){ + shell_hook = NULL){ stopifnot("'ide' has to be one of 'other', 'rstudio' or 'code'" = (ide %in% c("other", "rstudio", "code"))) @@ -410,7 +415,8 @@ testthat::test_that("Snapshot test of rix()", { ), ide = ide, project_path = path_default_nix, - overwrite = TRUE) + overwrite = TRUE, + shell_hook = NULL) paste0(path_default_nix, "/default.nix") @@ -455,7 +461,9 @@ testthat::test_that("Quarto gets added to sys packages", { r_pkgs = pkgs, ide = "other", project_path = path_default_nix, - overwrite = TRUE) + overwrite = TRUE, + shell_hook = NULL + ) paste0(path_default_nix, "/default.nix") diff --git a/dev/flat_with_nix.Rmd b/dev/flat_with_nix.Rmd index 90d8489d..84d3dd14 100644 --- a/dev/flat_with_nix.Rmd +++ b/dev/flat_with_nix.Rmd @@ -890,8 +890,6 @@ testthat::test_that("Testing `with_nix()` if Nix is installed", { # R version 3.5.3 on Nixpkgs does not build for aarch64-darwin (ARM macOS) skip_if(Sys.info()["sysname"] == "Darwin") - skip_on_covr() - path_subshell <- tempdir() rix_init( @@ -903,7 +901,8 @@ testthat::test_that("Testing `with_nix()` if Nix is installed", { rix( r_ver = "3.5.3", overwrite = TRUE, - project_path = path_subshell + project_path = path_subshell, + shell_hook = NULL ) out_subshell <- with_nix( @@ -919,12 +918,12 @@ testthat::test_that("Testing `with_nix()` if Nix is installed", { message_type = "simple" ) - # On a recent version of R, set.seed(1234);sample(seq(1,10), 5) - # returns c(10, 6, 5, 4, 1) - # but not on versions prior to 3.6 + # On a recent version of R, set.seed(1234);sample(seq(1,10), 5) + # returns c(10, 6, 5, 4, 1) + # but not on versions prior to 3.6 testthat::expect_true( - all(c(2, 6, 5, 8, 9) == out_subshell) - ) + all(c(2, 6, 5, 8, 9) == out_subshell) + ) }) testthat::test_that("Test `with_nix()` if Nix is installed on R 4.2.0", { @@ -936,8 +935,6 @@ testthat::test_that("Test `with_nix()` if Nix is installed on R 4.2.0", { skip_if_not(nix_shell_available()) - skip_on_covr() - path_subshell <- tempdir() rix_init( @@ -949,7 +946,8 @@ testthat::test_that("Test `with_nix()` if Nix is installed on R 4.2.0", { rix( r_ver = "4.2.0", overwrite = TRUE, - project_path = path_subshell + project_path = path_subshell, + shell_hook = NULL ) df <- data.frame(a = 1:3, b = 4:6) diff --git a/inst/extdata/default.nix b/inst/extdata/default.nix index ed6b84ac..8cf6aca8 100644 --- a/inst/extdata/default.nix +++ b/inst/extdata/default.nix @@ -1,34 +1,49 @@ -# This file was generated by the {rix} R package v0.5.1.9000 on 2024-01-29 +# This file was generated by the {rix} R package v0.5.1.9000 on 2024-02-02 # with following call: -# >rix(r_ver = "902d74314fae5eb824bc7b597bd4d39640345557", -# > r_pkgs = NULL, -# > system_pkgs = NULL, +# >rix(r_ver = "8ad5e8132c5dcf977e308e7bf5517cc6cc0bf7d8", +# > r_pkgs = c("dplyr", +# > "AER@1.2-8"), +# > system_pkgs = c("quarto"), # > git_pkgs = list(package_name = "rix", # > repo_url = "https://github.com/b-rodrigues/rix/", # > branch_name = "master", -# > commit = "11f6898fde38a4793a7f53900c88d2fd930e882f"), +# > commit = "da581f90273cb1ccfedbe18808097bf33b84d63c"), # > ide = "other", # > project_path = "inst/extdata", -# > overwrite = TRUE) -# It uses nixpkgs' revision 902d74314fae5eb824bc7b597bd4d39640345557 for reproducibility purposes -# which will install R version latest +# > overwrite = TRUE, +# > print = TRUE, +# > shell_hook = NULL) +# It uses nixpkgs' revision 8ad5e8132c5dcf977e308e7bf5517cc6cc0bf7d8 for reproducibility purposes +# which will install R as it was as of nixpkgs revision: 8ad5e8132c5dcf977e308e7bf5517cc6cc0bf7d8 # Report any issues to https://github.com/b-rodrigues/rix let - pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/902d74314fae5eb824bc7b597bd4d39640345557.tar.gz") {}; - git_archive_pkgs = [(pkgs.rPackages.buildRPackage { + pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/8ad5e8132c5dcf977e308e7bf5517cc6cc0bf7d8.tar.gz") {}; + rpkgs = builtins.attrValues { + inherit (pkgs.rPackages) dplyr; +}; + git_archive_pkgs = [(pkgs.rPackages.buildRPackage { name = "rix"; src = pkgs.fetchgit { url = "https://github.com/b-rodrigues/rix/"; branchName = "master"; - rev = "11f6898fde38a4793a7f53900c88d2fd930e882f"; - sha256 = "sha256-8Svbdu2qySZRfcXmf6PcqdtSJoHI2t9nC2XUUS9KuRo="; + rev = "da581f90273cb1ccfedbe18808097bf33b84d63c"; + sha256 = "sha256-eDAxkXSrX+Q5TWwzkwMDG5rB8VXFKaLJLLKEJEvxjeo="; + }; + propagatedBuildInputs = builtins.attrValues { + inherit (pkgs.rPackages) httr jsonlite sys; + }; + }) (pkgs.rPackages.buildRPackage { + name = "AER"; + src = pkgs.fetchzip { + url = "https://cran.r-project.org/src/contrib/Archive/AER/AER_1.2-8.tar.gz"; + sha256 = "sha256-OqxXcnUX/2C6wfD5fuNayc8OU+mstI3tt4eBVGQZ2S0="; }; propagatedBuildInputs = builtins.attrValues { - inherit (pkgs.rPackages) codetools httr jsonlite sys; + inherit (pkgs.rPackages) car lmtest sandwich survival zoo Formula; }; - }) ]; + })]; system_packages = builtins.attrValues { - inherit (pkgs) R glibcLocales nix ; + inherit (pkgs) R glibcLocales nix quarto; }; in pkgs.mkShell { @@ -40,6 +55,6 @@ let LC_PAPER = "en_US.UTF-8"; LC_MEASUREMENT = "en_US.UTF-8"; - buildInputs = [ git_archive_pkgs system_packages ]; - shellHook = "R --vanilla"; + buildInputs = [ git_archive_pkgs rpkgs system_packages ]; + } diff --git a/man/rix.Rd b/man/rix.Rd index 99be74f5..b3d28d05 100644 --- a/man/rix.Rd +++ b/man/rix.Rd @@ -14,7 +14,7 @@ rix( project_path = ".", overwrite = FALSE, print = FALSE, - shell_hook = "R --vanilla" + shell_hook = NULL ) } \arguments{ @@ -38,18 +38,22 @@ interactively use "rstudio" or "code" for Visual Studio Code. For other editors, use "other". This has been tested with RStudio, VS Code and Emacs. If other editors don't work, please open an issue.} -\item{project_path}{Character, defaults to the current working directory. Where to write -\code{default.nix}, for example "/home/path/to/project". -The file will thus be written to the file "/home/path/to/project/default.nix".} +\item{project_path}{Character, defaults to the current working directory. +Where to write \code{default.nix}, for example "/home/path/to/project". +The file will thus be written to the file +"/home/path/to/project/default.nix".} \item{overwrite}{Logical, defaults to FALSE. If TRUE, overwrite the \code{default.nix} file in the specified path.} \item{print}{Logical, defaults to FALSE. If TRUE, print \code{default.nix} to console.} -\item{shell_hook}{Character, defaults to \code{"R --vanilla"}. Commands added to the shell_hook get -executed when the Nix shell starts (via \code{shellHook}). So by default, using \verb{nix-shell default.nix} will -start R. Set to NULL if you want bash to be started instead.} +\item{shell_hook}{Character of length 1, defaults to \code{NULL}. Commands added +to the \code{shellHook} variable executed when the Nix shell starts. So +by default, using \verb{nix-shell default.nix} (or path with \code{shell.nix}) will +start a specific program, possibly with flags (separated by space), and/or +do shell actions. You can for example use \code{shell_hook = R}, if you want to +directly enter the declared Nix R session.} } \value{ Nothing, this function only has the side-effect of writing a file @@ -108,6 +112,7 @@ rix(r_ver = "latest", ide = "code", project_path = path_default_nix, overwrite = TRUE, - print = TRUE) + print = TRUE, + shell_hook = NULL) } } diff --git a/tests/testthat/_snaps/rix/code_default.nix b/tests/testthat/_snaps/rix/code_default.nix index 65111b74..e46898f0 100644 --- a/tests/testthat/_snaps/rix/code_default.nix +++ b/tests/testthat/_snaps/rix/code_default.nix @@ -54,5 +54,5 @@ let LC_MEASUREMENT = "en_US.UTF-8"; buildInputs = [ git_archive_pkgs rpkgs tex system_packages ]; - shellHook = "R --vanilla"; + } diff --git a/tests/testthat/_snaps/rix/no_quarto_default.nix b/tests/testthat/_snaps/rix/no_quarto_default.nix index 1ba16870..b74393e6 100644 --- a/tests/testthat/_snaps/rix/no_quarto_default.nix +++ b/tests/testthat/_snaps/rix/no_quarto_default.nix @@ -18,5 +18,5 @@ let LC_MEASUREMENT = "en_US.UTF-8"; buildInputs = [ rpkgs system_packages ]; - shellHook = "R --vanilla"; + } diff --git a/tests/testthat/_snaps/rix/other_default.nix b/tests/testthat/_snaps/rix/other_default.nix index e2154ee5..eaab8726 100644 --- a/tests/testthat/_snaps/rix/other_default.nix +++ b/tests/testthat/_snaps/rix/other_default.nix @@ -54,5 +54,5 @@ let LC_MEASUREMENT = "en_US.UTF-8"; buildInputs = [ git_archive_pkgs rpkgs tex system_packages ]; - shellHook = "R --vanilla"; + } diff --git a/tests/testthat/_snaps/rix/rstudio_default.nix b/tests/testthat/_snaps/rix/rstudio_default.nix index 167ad560..26adfcb6 100644 --- a/tests/testthat/_snaps/rix/rstudio_default.nix +++ b/tests/testthat/_snaps/rix/rstudio_default.nix @@ -57,5 +57,5 @@ let LC_MEASUREMENT = "en_US.UTF-8"; buildInputs = [ git_archive_pkgs rpkgs tex system_packages rstudio_pkgs ]; - shellHook = "R --vanilla"; + } diff --git a/tests/testthat/_snaps/rix/yes_quarto_default.nix b/tests/testthat/_snaps/rix/yes_quarto_default.nix index 1e4ffafa..89ec0bef 100644 --- a/tests/testthat/_snaps/rix/yes_quarto_default.nix +++ b/tests/testthat/_snaps/rix/yes_quarto_default.nix @@ -18,5 +18,5 @@ let LC_MEASUREMENT = "en_US.UTF-8"; buildInputs = [ rpkgs system_packages ]; - shellHook = "R --vanilla"; + } diff --git a/tests/testthat/test-nix_build.R b/tests/testthat/test-nix_build.R index d4d56076..4d54e667 100644 --- a/tests/testthat/test-nix_build.R +++ b/tests/testthat/test-nix_build.R @@ -23,7 +23,8 @@ testthat::test_that("Testing that `nix_build()` builds derivation", { rix( r_ver = "latest", overwrite = TRUE, - project_path = path_subshell + project_path = path_subshell, + shell_hook = NULL ) out <- nix_build( diff --git a/tests/testthat/test-rix.R b/tests/testthat/test-rix.R index 9fb98a55..4eddd4ea 100644 --- a/tests/testthat/test-rix.R +++ b/tests/testthat/test-rix.R @@ -21,7 +21,8 @@ testthat::test_that("Snapshot test of rix()", { ), ide = ide, project_path = path_default_nix, - overwrite = TRUE) + overwrite = TRUE, + shell_hook = NULL) paste0(path_default_nix, "/default.nix") @@ -64,7 +65,9 @@ testthat::test_that("Quarto gets added to sys packages", { r_pkgs = pkgs, ide = "other", project_path = path_default_nix, - overwrite = TRUE) + overwrite = TRUE, + shell_hook = NULL + ) paste0(path_default_nix, "/default.nix") diff --git a/tests/testthat/test-with_nix.R b/tests/testthat/test-with_nix.R index d4cfe3f2..833c3600 100644 --- a/tests/testthat/test-with_nix.R +++ b/tests/testthat/test-with_nix.R @@ -11,8 +11,6 @@ testthat::test_that("Testing `with_nix()` if Nix is installed", { # R version 3.5.3 on Nixpkgs does not build for aarch64-darwin (ARM macOS) skip_if(Sys.info()["sysname"] == "Darwin") - skip_on_covr() - path_subshell <- tempdir() rix_init( @@ -24,7 +22,8 @@ testthat::test_that("Testing `with_nix()` if Nix is installed", { rix( r_ver = "3.5.3", overwrite = TRUE, - project_path = path_subshell + project_path = path_subshell, + shell_hook = NULL ) out_subshell <- with_nix( @@ -40,12 +39,12 @@ testthat::test_that("Testing `with_nix()` if Nix is installed", { message_type = "simple" ) - # On a recent version of R, set.seed(1234);sample(seq(1,10), 5) - # returns c(10, 6, 5, 4, 1) - # but not on versions prior to 3.6 + # On a recent version of R, set.seed(1234);sample(seq(1,10), 5) + # returns c(10, 6, 5, 4, 1) + # but not on versions prior to 3.6 testthat::expect_true( - all(c(2, 6, 5, 8, 9) == out_subshell) - ) + all(c(2, 6, 5, 8, 9) == out_subshell) + ) }) testthat::test_that("Test `with_nix()` if Nix is installed on R 4.2.0", { @@ -57,8 +56,6 @@ testthat::test_that("Test `with_nix()` if Nix is installed on R 4.2.0", { skip_if_not(nix_shell_available()) - skip_on_covr() - path_subshell <- tempdir() rix_init( @@ -70,7 +67,8 @@ testthat::test_that("Test `with_nix()` if Nix is installed on R 4.2.0", { rix( r_ver = "4.2.0", overwrite = TRUE, - project_path = path_subshell + project_path = path_subshell, + shell_hook = NULL ) df <- data.frame(a = 1:3, b = 4:6) From 3f6631bd2f15effb10fa13a5ff7c5c3c023165d8 Mon Sep 17 00:00:00 2001 From: Philipp Baumann Date: Fri, 2 Feb 2024 14:48:07 +0100 Subject: [PATCH 2/7] take Nixpkgs revision that works for macOS --- inst/extdata/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inst/extdata/default.nix b/inst/extdata/default.nix index 8cf6aca8..a7d9088b 100644 --- a/inst/extdata/default.nix +++ b/inst/extdata/default.nix @@ -1,6 +1,6 @@ # This file was generated by the {rix} R package v0.5.1.9000 on 2024-02-02 # with following call: -# >rix(r_ver = "8ad5e8132c5dcf977e308e7bf5517cc6cc0bf7d8", +# >rix(r_ver = "94b122adfc90316feaea838f29aa3f2e3de2b203", # > r_pkgs = c("dplyr", # > "AER@1.2-8"), # > system_pkgs = c("quarto"), @@ -13,11 +13,11 @@ # > overwrite = TRUE, # > print = TRUE, # > shell_hook = NULL) -# It uses nixpkgs' revision 8ad5e8132c5dcf977e308e7bf5517cc6cc0bf7d8 for reproducibility purposes -# which will install R as it was as of nixpkgs revision: 8ad5e8132c5dcf977e308e7bf5517cc6cc0bf7d8 +# It uses nixpkgs' revision 94b122adfc90316feaea838f29aa3f2e3de2b203 for reproducibility purposes +# which will install R as it was as of nixpkgs revision: 94b122adfc90316feaea838f29aa3f2e3de2b203 # Report any issues to https://github.com/b-rodrigues/rix let - pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/8ad5e8132c5dcf977e308e7bf5517cc6cc0bf7d8.tar.gz") {}; + pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/94b122adfc90316feaea838f29aa3f2e3de2b203.tar.gz") {}; rpkgs = builtins.attrValues { inherit (pkgs.rPackages) dplyr; }; From 118084149c521b55c08fe68c906b739b5571e9fe Mon Sep 17 00:00:00 2001 From: Philipp Baumann Date: Fri, 2 Feb 2024 15:04:36 +0100 Subject: [PATCH 3/7] add covr runner for system-R with Nix --- .github/workflows/tests-r-via-system.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests-r-via-system.yaml b/.github/workflows/tests-r-via-system.yaml index 55e375f2..65c89ae0 100644 --- a/.github/workflows/tests-r-via-system.yaml +++ b/.github/workflows/tests-r-via-system.yaml @@ -28,13 +28,23 @@ jobs: - name: Install R packages uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::devtools, any::codetools + extra-packages: any::devtools, any::codetools any::covr - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - name: devtools::test() via system R run: Rscript -e 'devtools::test()' + + - name: covr::codecov() via system R + run: | + covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") + ) + shell: Rscript {0} + - name: Show testthat output run: | From a781b51c13e16a19cfcf2b06f7c1363f21f409ed Mon Sep 17 00:00:00 2001 From: Philipp Baumann Date: Fri, 2 Feb 2024 15:15:29 +0100 Subject: [PATCH 4/7] try avoid failed tests --- .github/workflows/tests-r-via-system.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests-r-via-system.yaml b/.github/workflows/tests-r-via-system.yaml index 65c89ae0..14a27329 100644 --- a/.github/workflows/tests-r-via-system.yaml +++ b/.github/workflows/tests-r-via-system.yaml @@ -37,12 +37,8 @@ jobs: run: Rscript -e 'devtools::test()' - name: covr::codecov() via system R - run: | - covr::codecov( - quiet = FALSE, - clean = FALSE, - install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") - ) + run: RScript -e 'covr::codecov(quiet = FALSE, clean = FALSE) + shell: Rscript {0} From 9bda59a516a70b1442e1ce3de05d003273abb662 Mon Sep 17 00:00:00 2001 From: Philipp Baumann Date: Fri, 2 Feb 2024 15:24:42 +0100 Subject: [PATCH 5/7] remove `LD_LIBRARY_PATH` --- .github/workflows/tests-r-via-system.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-r-via-system.yaml b/.github/workflows/tests-r-via-system.yaml index 14a27329..46173ddb 100644 --- a/.github/workflows/tests-r-via-system.yaml +++ b/.github/workflows/tests-r-via-system.yaml @@ -37,7 +37,7 @@ jobs: run: Rscript -e 'devtools::test()' - name: covr::codecov() via system R - run: RScript -e 'covr::codecov(quiet = FALSE, clean = FALSE) + run: RScript -e 'Sys.setenv("LD_LIBRARY_PATH"=""), covr::codecov(quiet = FALSE, clean = FALSE) shell: Rscript {0} From ac8e0584a0a31b4e30f5c5710a84a2bc1fd8ac9e Mon Sep 17 00:00:00 2001 From: Philipp Baumann Date: Fri, 2 Feb 2024 15:26:32 +0100 Subject: [PATCH 6/7] back to default install_path --- .github/workflows/tests-r-via-system.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-r-via-system.yaml b/.github/workflows/tests-r-via-system.yaml index 46173ddb..864e238c 100644 --- a/.github/workflows/tests-r-via-system.yaml +++ b/.github/workflows/tests-r-via-system.yaml @@ -37,7 +37,7 @@ jobs: run: Rscript -e 'devtools::test()' - name: covr::codecov() via system R - run: RScript -e 'Sys.setenv("LD_LIBRARY_PATH"=""), covr::codecov(quiet = FALSE, clean = FALSE) + run: RScript -e 'Sys.setenv("LD_LIBRARY_PATH"=""), covr::codecov(quiet = FALSE, clean = FALSE, install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")) shell: Rscript {0} From c46552bbc7719920a47764d31989c16019826f87 Mon Sep 17 00:00:00 2001 From: Philipp Baumann Date: Fri, 2 Feb 2024 15:34:42 +0100 Subject: [PATCH 7/7] no shell just use Rscript directly --- .github/workflows/tests-r-via-system.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests-r-via-system.yaml b/.github/workflows/tests-r-via-system.yaml index 864e238c..58c16de7 100644 --- a/.github/workflows/tests-r-via-system.yaml +++ b/.github/workflows/tests-r-via-system.yaml @@ -36,11 +36,8 @@ jobs: - name: devtools::test() via system R run: Rscript -e 'devtools::test()' - - name: covr::codecov() via system R - run: RScript -e 'Sys.setenv("LD_LIBRARY_PATH"=""), covr::codecov(quiet = FALSE, clean = FALSE, install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")) - - shell: Rscript {0} - + - name: covr::codecov() via system R + run: RScript -e 'covr::codecov(quiet = FALSE, clean = FALSE, install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")) - name: Show testthat output run: |