Skip to content

Commit

Permalink
Merge pull request #44 from insightsengineering/fix_rcmdcheck_automation
Browse files Browse the repository at this point in the history
use newest version of `staged.dependencies`
  • Loading branch information
waddella authored Sep 16, 2021
2 parents 638014c + 2a2507b commit d4a1f2c
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 25 deletions.
30 changes: 13 additions & 17 deletions .github/workflows/build-check-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,19 @@ jobs:
fail-fast: false
matrix:
config:
- {image: waddella/rocker_rstudio_4.1.0_deps, tag: 'latest'}
- {image: ghcr.io/insightsengineering/rstudio_4.1.0_bioc_3.13, tag: 'latest'}

steps:

# TODO: add qpdf
- name: Check if Docker Image meets Requirements
- name: Check if Docker image meets requirements
run: |
lsb=$(lsb_release -d)
[[ ! $lsb =~ "Ubuntu" ]] && exit 1
for PKG in r-base curl git
do
dpkg -l $PKG
if [[ ! $? ]]; then
echo "System package $PGK is not available"
exit 1
fi
required_pkgs="r-base curl git"
for PKG in $required_pkgs
do {
DPKG_PAGER=cat dpkg -l $PKG
}
done
shell: bash

Expand Down Expand Up @@ -66,7 +61,6 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.REPO_GITHUB_TOKEN }} # or ${{ secrets.GITHUB_TOKEN }}


- name: Checkout repo during PR
uses: actions/checkout@v2
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -106,7 +100,6 @@ jobs:
}
shell: Rscript {0}


- name: Install R package dependencies
run: |
setwd("${{ github.event.repository.name }}")
Expand All @@ -121,11 +114,14 @@ jobs:
if (file.exists("staged_dependencies.yaml")) {
cat("\nInstall Staged Dependencies\n\n\n")
if (!require("staged.dependencies")) remotes::install_github("openpharma/staged.dependencies", ref = "main", Ncpus = ncores)
if (!require("staged.dependencies")) {
remotes::install_github("openpharma/staged.dependencies", ref = "v0.2", Ncpus = ncores, upgrade = "never")
}
cat("\nCalculating Staged Dependency Table...\n\n")
print(staged.dependencies::dependency_table(), width = 120)
x <- staged.dependencies::dependency_table()
print(x, width = 120)
cat("\n\n")
staged.dependencies::install_deps(install_project = FALSE, verbose = TRUE)
staged.dependencies::install_deps(dep_structure = x, install_project = FALSE, verbose = TRUE)
}
shell: Rscript {0}
env:
Expand All @@ -138,13 +134,13 @@ jobs:
shell: bash

# TODO: if configurable then --as-cran optionally
# TODO: TESTING_DEPTH
- name: Run R CMD CHECK
run: R CMD check --no-manual ${{ env.PKGBUILD }}
shell: bash
continue-on-error: true
env:
TESTING_DEPTH: 1
_R_CHECK_TESTS_NLINES_: 0

- name: Catch warnings in R CMD check output
id: catch-errors
Expand Down
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ Roxygen: list(markdown = TRUE)
License: file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
Depends:
R (>= 4.0.0),
tern
Imports:
rtables,
assertthat,
dplyr,
rlang
rlang,
magrittr
Suggests:
scda.2021,
scda,
Expand Down
2 changes: 1 addition & 1 deletion R/dst01.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ check_dst01_1_args <- function(reason, status, status_treatment) {
#' study a reason is provided.
#'
#' @inheritParams gen_args
#' @param arm (`string`) variable. Usually one of `ARM`, `ACTARM`, `TRT01A`, or `TRT01A`.
#' @param armvar (`string`) variable. Usually one of `ARM`, `ACTARM`, `TRT01A`, or `TRT01A`.
#' @param status (`string`) variable used to define patient status. Default is `EOSSTT`, however can also be a variable
#' name with the pattern `EOPxxSTT` where `xx` must be substituted by 2 digits referring to the analysis period.
#' @param reason (`string`) variable used to define reason for patient withdrawal. Default is `DCSREAS`, however can
Expand Down
7 changes: 7 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# as we use NSE
globalVariables(c("ANL01FL", "adae", "ANL01FL"))

#' Retrieve Variables for Certain variables
#'
#' @param df data froma
#' @param vars variable names in data frame `df`
#'
#' @importFrom assertthat assert_that
#' @importFrom rtables var_labels
#' @export
Expand Down
4 changes: 1 addition & 3 deletions man/dst01_1.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/dst01_2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/dst01_3.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions man/var_labels_for.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d4a1f2c

Please sign in to comment.