fix(local): make the trial-build gate detect non-throwing build failures #130
1 changed files with 25 additions and 14 deletions
|
|
@ -117,23 +117,34 @@ results <- vapply(
|
||||||
pkgs,
|
pkgs,
|
||||||
function(pkg) {
|
function(pkg) {
|
||||||
cat(sprintf("\n=== trial build: %s ===\n", pkg))
|
cat(sprintf("\n=== trial build: %s ===\n", pkg))
|
||||||
tryCatch(
|
# bincraft::build_binary_package() catches build failures internally and
|
||||||
{
|
# RETURNS "error" for the failed tag rather than throwing, so a green gate
|
||||||
bincraft::build_binary_package(
|
# must inspect the return value -- checking only for a thrown exception
|
||||||
pkg,
|
# reports a broken build as passing.
|
||||||
tag_limit = 1L,
|
res <- tryCatch(
|
||||||
patches = patches_dir,
|
bincraft::build_binary_package(
|
||||||
archive = FALSE,
|
pkg,
|
||||||
upload = FALSE,
|
tag_limit = 1L,
|
||||||
store_build_metadata = FALSE
|
patches = patches_dir,
|
||||||
)
|
archive = FALSE,
|
||||||
TRUE
|
upload = FALSE,
|
||||||
},
|
store_build_metadata = FALSE
|
||||||
|
),
|
||||||
error = function(e) {
|
error = function(e) {
|
||||||
cat(sprintf("FAILED %s: %s\n", pkg, conditionMessage(e)))
|
cat(sprintf("FAILED %s (threw): %s\n", pkg, conditionMessage(e)))
|
||||||
FALSE
|
"error"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
flat <- as.character(unlist(res))
|
||||||
|
ok <- length(flat) > 0L && !("error" %in% flat)
|
||||||
|
if (!ok) {
|
||||||
|
cat(sprintf(
|
||||||
|
"FAILED %s: build did not succeed (result: %s)\n",
|
||||||
|
pkg,
|
||||||
|
if (length(flat) > 0L) toString(flat) else "<empty>"
|
||||||
|
))
|
||||||
|
}
|
||||||
|
ok
|
||||||
},
|
},
|
||||||
logical(1L)
|
logical(1L)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue