-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renovate, check without suggested packages, parallel and ccache
- Loading branch information
Showing
7 changed files
with
252 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: "Actions to compute a matrix with all suggested packages" | ||
outputs: | ||
matrix: | ||
description: "Generated matrix" | ||
value: ${{ steps.set-matrix.outputs.matrix }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- id: set-matrix | ||
run: | | ||
get_deps <- function() { | ||
# Determine package dependencies | ||
if (!requireNamespace("desc", quietly = TRUE)) { | ||
install.packages("desc") | ||
} | ||
deps_df <- desc::desc_get_deps() | ||
deps_df_optional <- deps_df$package[deps_df$type %in% c("Suggests", "Enhances")] | ||
deps_df_hard <- deps_df$package[deps_df$type %in% c("Depends", "Imports", "LinkingTo")] | ||
packages <- sort(deps_df_optional) | ||
packages <- intersect(packages, rownames(available.packages())) | ||
# Too big to fail, or can't be avoided: | ||
off_limits <- c("testthat", "rmarkdown", "rcmdcheck", deps_df_hard) | ||
off_limits_dep <- unlist(tools::package_dependencies(off_limits, recursive = TRUE, which = "strong")) | ||
setdiff(packages, c(off_limits, off_limits_dep)) | ||
} | ||
if (Sys.getenv("GITHUB_BASE_REF") != "") { | ||
print(Sys.getenv("GITHUB_BASE_REF")) | ||
has_diff <- (system("git diff ${{ github.event.pull_request.base.sha }}... | egrep '^[+][^+]' | grep -q ::") == 0) | ||
if (has_diff) { | ||
system("git diff ${{ github.event.pull_request.base.sha }}... | egrep '^[+][^+]' | grep -q ::") | ||
packages <- get_deps() | ||
} else { | ||
writeLines("No changes using :: found, not checking without suggested packages") | ||
packages <- character() | ||
} | ||
} else { | ||
packages <- get_deps() | ||
} | ||
if (length(packages) > 0) { | ||
json <- paste0( | ||
'{"package":[', | ||
paste0('"', packages, '"', collapse = ","), | ||
']}' | ||
) | ||
writeLines(json) | ||
writeLines(paste0("matrix=", json), Sys.getenv("GITHUB_OUTPUT")) | ||
} else { | ||
writeLines("Package list empty!") | ||
} | ||
shell: Rscript {0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters