Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
walkowif committed May 9, 2024
1 parent b12fb0c commit 78c0777
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ runs:

- name: Install dependencies
run: |
echo "INPUT_REPORT_PKG_DIR: ${{ inputs.report_pkg_dir }}"
${GITHUB_ACTION_PATH}/dependencies.R
[ ! -f "./template.qmd" ] && cp ${GITHUB_ACTION_PATH}/template.qmd . || echo "./template.qmd already exists"
shell: bash
Expand All @@ -69,6 +68,6 @@ runs:
env:
# Composite action doesn't set inputs as env vars.
# We need to do this manually...
INPUT_REPORT_PACKAGE_DIR: ${{ inputs.report_pkg_dir }}
INPUT_REPORT_PKG_DIR: ${{ inputs.report_pkg_dir }}
INPUT_REPORT_TEMPLATE_PATH: ${{ inputs.report_template_path }}
DISABLE_INSTALL_DEV_DEPS: ${{ inputs.disable_install_dev_deps }}
4 changes: 2 additions & 2 deletions dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ options(repos = c("https://cloud.r-project.org/"))
ncores <- parallel::detectCores(all.tests = FALSE, logical = TRUE)
if (!require("git2r")) install.packages("git2r", upgrade = "never", Ncpus = ncores)
if (!require("quarto")) install.packages("quarto", upgrade = "never", Ncpus = ncores)
if (!require("kableExtra")) install.packages("kableExtra", upgrade = "never", Ncpus = ncores)
if (!require("knitr")) install.packages("knitr", upgrade = "never", Ncpus = ncores)
# if (!require("kableExtra")) install.packages("kableExtra", upgrade = "never", Ncpus = ncores)

Check warning on line 18 in dependencies.R

View workflow job for this annotation

GitHub Actions / Lint Code Base

file=/github/workspace/dependencies.R,line=18,col=3,[commented_code_linter] Commented code should be removed.
# if (!require("knitr")) install.packages("knitr", upgrade = "never", Ncpus = ncores)

Check warning on line 19 in dependencies.R

View workflow job for this annotation

GitHub Actions / Lint Code Base

file=/github/workspace/dependencies.R,line=19,col=3,[commented_code_linter] Commented code should be removed.
if (!require("tinytable")) install.packages("tinytable", upgrade = "never", Ncpus = ncores)
14 changes: 7 additions & 7 deletions template.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Validation Report - `r sprintf('%s (v%s)',(dcf <- read.dcf(file.path(Sys.getenv('INPUT_REPORT_PACKAGE_DIR', '.'), 'DESCRIPTION')))[,'Package'], dcf[,'Version'])`"
title: "Validation Report - `r sprintf('%s (v%s)',(dcf <- read.dcf(file.path(Sys.getenv('INPUT_REPORT_PKG_DIR', '.'), 'DESCRIPTION')))[,'Package'], dcf[,'Version'])`"
date: "`r Sys.time()`"
date-format: "ddd MMM DD hh:mm:ss A YYYY"
format:
Expand All @@ -15,7 +15,7 @@ format:
```{r setup, include = FALSE}
options(width = 80L, covr.record_tests = TRUE)
remotes::install_local(
Sys.getenv('INPUT_REPORT_PACKAGE_DIR', '.'),
Sys.getenv('INPUT_REPORT_PKG_DIR', '.'),
force = TRUE,
quiet = TRUE,
INSTALL_opts = "--with-keep.source",
Expand Down Expand Up @@ -64,12 +64,12 @@ tt(
```{r version_control, echo = FALSE}
# find .git dir containing the package directory
gd <- system(
sprintf("cd '%s' && git rev-parse --absolute-git-dir", Sys.getenv('INPUT_REPORT_PACKAGE_DIR', '.')),
sprintf("cd '%s' && git rev-parse --absolute-git-dir", Sys.getenv('INPUT_REPORT_PKG_DIR', '.')),
intern = TRUE
)
# define reused git args to be sure we're picking up the right git info
gd <- sprintf("--git-dir='%s'", gd)
wt <- sprintf("--work-tree='%s'", Sys.getenv('INPUT_REPORT_PACKAGE_DIR', '.'))
wt <- sprintf("--work-tree='%s'", Sys.getenv('INPUT_REPORT_PKG_DIR', '.'))
tt_git_df <- data.frame(
Field = c("server", "repository", "git ref", "branch", "commit `SHA1`", "commit date"),
Value = c(
Expand Down Expand Up @@ -109,7 +109,7 @@ capabilities()
The following metrics are derived from the `riskmetric` R package. Metrics overlapping with `covr` and `R CMD Check` are removed.

```{r riskmetric, echo = FALSE, eval = TRUE}
d_riskmetric <- Sys.getenv('INPUT_REPORT_PACKAGE_DIR', '.') %>%
d_riskmetric <- Sys.getenv('INPUT_REPORT_PKG_DIR', '.') %>%
riskmetric::pkg_ref() %>%
riskmetric::pkg_assess() %>%
purrr::map(1) %>%
Expand Down Expand Up @@ -145,7 +145,7 @@ tt(

```{r r_cmd_check, echo = FALSE, eval = TRUE}
rcmdcheck_results <- rcmdcheck::rcmdcheck(
Sys.getenv('INPUT_REPORT_PACKAGE_DIR', '.'),
Sys.getenv('INPUT_REPORT_PKG_DIR', '.'),
args = c(
"--timings", # include execution times in output
"--no-build-vignettes", # run vignette code, but disable pdf rendering
Expand All @@ -161,7 +161,7 @@ cat(rcmdcheck_results$stderr)
## Testing Coverage

```{r coverage, echo = FALSE, eval = TRUE}
covr_results <- covr::package_coverage(Sys.getenv('INPUT_REPORT_PACKAGE_DIR', '.'))
covr_results <- covr::package_coverage(Sys.getenv('INPUT_REPORT_PKG_DIR', '.'))
covr_results
```

Expand Down

0 comments on commit 78c0777

Please sign in to comment.