test build

This commit is contained in:
Patrick Schratz 2024-07-25 00:05:03 +02:00
commit 6626843a03
Signed by: pat-s
GPG key ID: 3C6318841EF78925
2 changed files with 4 additions and 4 deletions

View file

@ -28,8 +28,8 @@ steps:
# download latest package version (avoid having to rebuild image every time)
# rscript_startup arg: required to pass down global option to future workers https://github.com/HenrikBengtsson/future/issues/134#issuecomment-2245666169
- git clone https://pat-s:$$git_ro_token@git.devxy.io/devxy/arm64-r-binaries.git && cd arm64-r-binaries
- R -q -e 'install.packages(".", repos = NULL, quiet = TRUE); packageVersion("rBinaries")'
- R -q -e 'options(crayon.enabled = TRUE, Ncpus = 4, future.globals.onReference = "error"); pkgs = tools::CRAN_package_db()[[1]][1:20]; library(rBinaries); future::plan("multisession", workers = 4, rscript_startup = quote(options(crayon.enabled = TRUE))); foo = lapply(pkgs, function(x) build_binary_package(x, build_for_minor=FALSE, debug = FALSE, force = TRUE))'
- R -q -e 'install.packages(".", repos = NULL, quiet = FALSE); packageVersion("rBinaries")'
- R -q -e 'options(crayon.enabled = TRUE, Ncpus = 4, future.globals.onReference = "error"); pkgs = tools::CRAN_package_db()[[1]][17:17]; library(rBinaries); future::plan("multisession", workers = 4, rscript_startup = quote(options(crayon.enabled = TRUE))); foo = lapply(pkgs, function(x) build_binary_package(x, build_for_minor=FALSE, debug = FALSE, force = TRUE))'
backend_options:
kubernetes:
resources:

View file

@ -1,7 +1,7 @@
#' @importFrom DBI dbConnect dbDisconnect dbWriteTable dbGetQuery dbExecute
store_build_metadata <- function(
package_name, tag, platform,
error_occurred, error, force = FALSE, error = NULL) {
error_occurred, force = FALSE, error = NULL) {
con <- DBI::dbConnect(RPostgres::Postgres(),
dbname = "build_metadata", host = "postgres-arm-binaries-r.devxy.io",
port = 15432, user = "arm_binaries", password = Sys.getenv("PGPASS")
@ -18,7 +18,7 @@ store_build_metadata <- function(
} else if (nrow(existing_entries) >= 1 && force) {
cli::cli_alert_info("{.fun store_build_metadata}: Force overwriting build metadata for {.pkg {package_name}} {.field {tag}} because {.code force = TRUE} was set.")
dbExecute(con, sprintf("UPDATE single_builds SET build_timestamp = '%s', error_occurred = %s, error = '%s' WHERE package_name = '%s' and tag = '%s'", format(Sys.time(), "%Y-%m-%d %H:%M:%S"), error_occurred, error, package_name, tag))
DBI::dbExecute(con, sprintf("UPDATE single_builds SET build_timestamp = '%s', error_occurred = %s, error = '%s' WHERE package_name = '%s' and tag = '%s'", format(Sys.time(), "%Y-%m-%d %H:%M:%S"), error_occurred, error, package_name, tag))
} else if (nrow(existing_entries) == 0) {
cli::cli_alert("{.fun store_build_metadata}: Storing build metadata for {.pkg {package_name}} {.field {tag}}.")
# Create a data frame with the metadata