generated from pharmaverse/admiraltemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8a85b01
Showing
62 changed files
with
10,264 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
^renv$ | ||
^renv\.lock$ | ||
^.*\.Rproj$ | ||
^.*\.lycheeignore$ | ||
^\.Rproj\.user$ | ||
^pkgdown$ | ||
^_pkgdown\.yml$ | ||
^.github$ | ||
^.lintr$ | ||
^docs$ | ||
^Meta$ | ||
^codecov\.yml$ | ||
^man/dev_util_.+\.Rd$ | ||
^LICENSE\.md$ | ||
^\.github$ | ||
^admiraltemplate\.Rcheck$ | ||
^admiraltemplate.*\.tar\.gz$ | ||
^admiraltemplate.*\.tgz$ | ||
^staged_dependencies.yaml$ | ||
^README.Rmd$ | ||
^\.devcontainer$ |
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,48 @@ | ||
# Set renv profile base on R version. | ||
.get_dependencies <- function(project_dir) { | ||
|
||
admdev_loc <- find.package("admiraldev", lib.loc = .libPaths(), quiet = TRUE) | ||
adm_dev_suggests <- if(length(admdev_loc) != 0) { | ||
renv:::renv_dependencies_discover_description(admdev_loc, fields = c("Depends", "Imports", "LinkingTo", "Suggests")) | ||
} else { | ||
data.frame(Packages = character(0)) | ||
} | ||
suggests_packages <- renv:::renv_dependencies_discover_description(project_dir, fields = "Suggests") | ||
|
||
packages <- names( | ||
renv:::renv_package_dependencies( | ||
unique(c( | ||
project_dir, | ||
adm_dev_suggests[["Package"]], | ||
suggests_packages[["Package"]], | ||
c("staged.dependencies", "renv", "styler") | ||
)) | ||
) | ||
) | ||
packages[!(packages %in% c("admiral", "admiraldev", "admiralci", "admiral.test", "pharmaversesdtm", getwd()))] | ||
} | ||
|
||
options(renv.snapshot.filter = .get_dependencies) | ||
|
||
.renv_profile <- paste(R.version$major, substr(R.version$minor, 1, 1), sep = ".") | ||
if (!file.exists("./renv/profile")) { | ||
if (.renv_profile %in% c("4.1", "4.2", "4.3")) { | ||
message("Set renv profile to `", .renv_profile, "`") | ||
Sys.setenv("RENV_PROFILE" = .renv_profile) | ||
} else { | ||
message("This repository do not contains the renv profile for your R version.") | ||
} | ||
} else { | ||
message( | ||
"Using renv profile from `renv/profile` file.\n", | ||
"The `", readLines("./renv/profile"), "` profile will be used." | ||
) | ||
} | ||
|
||
if (Sys.getenv("GITHUB_ACTIONS") != "") { | ||
options(repos = c(CRAN = "https://packagemanager.posit.co/cran/latest")) | ||
Sys.setenv("RENV_AUTOLOADER_ENABLED" = FALSE) | ||
} | ||
Sys.setenv("RENV_CONFIG_SANDBOX_ENABLED" = FALSE) | ||
Sys.setenv("RENV_CONFIG_AUTO_SNAPSHOT" = FALSE) | ||
source("renv/activate.R") |
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,76 @@ | ||
{ | ||
// https://containers.dev/implementors/json_reference/ | ||
"name": "Admiral R-4.1 (RStudio) container", | ||
"image": "ghcr.io/pharmaverse/admiralci-4.1:latest", | ||
// Install Dev Container Features. More info: https://containers.dev/features | ||
"containerEnv": { | ||
"ROOT": "true", | ||
"PASSWORD": "rstudio", | ||
"DISABLE_AUTH": "true", | ||
"RENV_AUTOLOADER_ENABLED": "false" | ||
}, | ||
"features": { | ||
"ghcr.io/rocker-org/devcontainer-features/r-rig:1": { | ||
"version": "none", | ||
"vscodeRSupport": "full", | ||
"installRadian": true, | ||
"installVscDebugger": true | ||
}, | ||
"ghcr.io/rocker-org/devcontainer-features/renv-cache:latest": {}, | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"installZsh": true, | ||
"configureZshAsDefaultShell": false, | ||
"installOhMyZsh": true, | ||
"username": "rstudio", | ||
"upgradePackages": false | ||
}, | ||
"ghcr.io/mikaello/devcontainer-features/modern-shell-utils:1": {} | ||
}, | ||
"init": true, | ||
"overrideCommand": false, | ||
|
||
"postCreateCommand": "bash ./.devcontainer/postCreateCommand.sh", | ||
|
||
"postAttachCommand": "$BROWSER \"https://${CODESPACE_NAME}-8787.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/\"", | ||
|
||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"r.rterm.linux": "/usr/local/bin/radian", | ||
"r.bracketedPaste": true, | ||
"editor.bracketPairColorization.enabled": true, | ||
"editor.guides.bracketPairs": "active" | ||
}, | ||
"extensions": [ | ||
"vsls-contrib.codetour", | ||
"GitHub.copilot", | ||
"GitHub.copilot-chat", | ||
// R extensions | ||
"ikuyadeu.r", | ||
"REditorSupport.r-lsp", | ||
// Extra extension | ||
"streetsidesoftware.code-spell-checker", | ||
"eamodio.gitlens", | ||
"cweijan.vscode-office", | ||
"donjayamanne.githistory", | ||
"GitHub.vscode-github-actions", | ||
"GitHub.vscode-pull-request-github", | ||
"GitHub.remotehub", | ||
"alefragnani.Bookmarks", | ||
"vscode-icons-team.vscode-icons" | ||
] | ||
} | ||
}, | ||
|
||
// RStudio ports | ||
"forwardPorts": [8787], | ||
"portsAttributes": { | ||
"8787": { | ||
"label": "Rstudio", | ||
"requireLocalPort": true, | ||
"onAutoForward": "openBrowser" | ||
} | ||
}, | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root | ||
"remoteUser": "rstudio" | ||
} |
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,76 @@ | ||
{ | ||
// https://containers.dev/implementors/json_reference/ | ||
"name": "Admiral R-4.2 (RStudio) container", | ||
"image": "ghcr.io/pharmaverse/admiralci-4.2:latest", | ||
// Install Dev Container Features. More info: https://containers.dev/features | ||
"containerEnv": { | ||
"ROOT": "true", | ||
"PASSWORD": "rstudio", | ||
"DISABLE_AUTH": "true", | ||
"RENV_AUTOLOADER_ENABLED": "false" | ||
}, | ||
"features": { | ||
"ghcr.io/rocker-org/devcontainer-features/r-rig:1": { | ||
"version": "none", | ||
"vscodeRSupport": "full", | ||
"installRadian": true, | ||
"installVscDebugger": true | ||
}, | ||
"ghcr.io/rocker-org/devcontainer-features/renv-cache:latest": {}, | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"installZsh": true, | ||
"configureZshAsDefaultShell": false, | ||
"installOhMyZsh": true, | ||
"username": "rstudio", | ||
"upgradePackages": false | ||
}, | ||
"ghcr.io/mikaello/devcontainer-features/modern-shell-utils:1": {} | ||
}, | ||
"init": true, | ||
"overrideCommand": false, | ||
|
||
"postCreateCommand": "bash ./.devcontainer/postCreateCommand.sh", | ||
|
||
"postAttachCommand": "$BROWSER \"https://${CODESPACE_NAME}-8787.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/\"", | ||
|
||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"r.rterm.linux": "/usr/local/bin/radian", | ||
"r.bracketedPaste": true, | ||
"editor.bracketPairColorization.enabled": true, | ||
"editor.guides.bracketPairs": "active" | ||
}, | ||
"extensions": [ | ||
"vsls-contrib.codetour", | ||
"GitHub.copilot", | ||
"GitHub.copilot-chat", | ||
// R extensions | ||
"ikuyadeu.r", | ||
"REditorSupport.r-lsp", | ||
// Extra extension | ||
"streetsidesoftware.code-spell-checker", | ||
"eamodio.gitlens", | ||
"cweijan.vscode-office", | ||
"donjayamanne.githistory", | ||
"GitHub.vscode-github-actions", | ||
"GitHub.vscode-pull-request-github", | ||
"GitHub.remotehub", | ||
"alefragnani.Bookmarks", | ||
"vscode-icons-team.vscode-icons" | ||
] | ||
} | ||
}, | ||
|
||
// RStudio ports | ||
"forwardPorts": [8787], | ||
"portsAttributes": { | ||
"8787": { | ||
"label": "Rstudio", | ||
"requireLocalPort": true, | ||
"onAutoForward": "openBrowser" | ||
} | ||
}, | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root | ||
"remoteUser": "rstudio" | ||
} |
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,76 @@ | ||
{ | ||
// https://containers.dev/implementors/json_reference/ | ||
"name": "Admiral R-4.3 (RStudio) container", | ||
"image": "ghcr.io/pharmaverse/admiralci-4.3:latest", | ||
// Install Dev Container Features. More info: https://containers.dev/features | ||
"containerEnv": { | ||
"ROOT": "true", | ||
"PASSWORD": "rstudio", | ||
"DISABLE_AUTH": "true", | ||
"RENV_AUTOLOADER_ENABLED": "false" | ||
}, | ||
"features": { | ||
"ghcr.io/rocker-org/devcontainer-features/r-rig:1": { | ||
"version": "none", | ||
"vscodeRSupport": "full", | ||
"installRadian": true, | ||
"installVscDebugger": true | ||
}, | ||
"ghcr.io/rocker-org/devcontainer-features/renv-cache:latest": {}, | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"installZsh": true, | ||
"configureZshAsDefaultShell": false, | ||
"installOhMyZsh": true, | ||
"username": "rstudio", | ||
"upgradePackages": false | ||
}, | ||
"ghcr.io/mikaello/devcontainer-features/modern-shell-utils:1": {} | ||
}, | ||
"init": true, | ||
"overrideCommand": false, | ||
|
||
"postCreateCommand": "bash ./.devcontainer/postCreateCommand.sh", | ||
|
||
"postAttachCommand": "$BROWSER \"https://${CODESPACE_NAME}-8787.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/\"", | ||
|
||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"r.rterm.linux": "/usr/local/bin/radian", | ||
"r.bracketedPaste": true, | ||
"editor.bracketPairColorization.enabled": true, | ||
"editor.guides.bracketPairs": "active" | ||
}, | ||
"extensions": [ | ||
"vsls-contrib.codetour", | ||
"GitHub.copilot", | ||
"GitHub.copilot-chat", | ||
// R extensions | ||
"ikuyadeu.r", | ||
"REditorSupport.r-lsp", | ||
// Extra extension | ||
"streetsidesoftware.code-spell-checker", | ||
"eamodio.gitlens", | ||
"cweijan.vscode-office", | ||
"donjayamanne.githistory", | ||
"GitHub.vscode-github-actions", | ||
"GitHub.vscode-pull-request-github", | ||
"GitHub.remotehub", | ||
"alefragnani.Bookmarks", | ||
"vscode-icons-team.vscode-icons" | ||
] | ||
} | ||
}, | ||
|
||
// RStudio ports | ||
"forwardPorts": [8787], | ||
"portsAttributes": { | ||
"8787": { | ||
"label": "Rstudio", | ||
"requireLocalPort": true, | ||
"onAutoForward": "openBrowser" | ||
} | ||
}, | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root | ||
"remoteUser": "rstudio" | ||
} |
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,5 @@ | ||
#!/bin/bash | ||
|
||
R -q -e 'renv::restore(lockfile = file.path("renv", "profiles", paste(R.version$major, substr(R.version$minor, 1, 1), sep = "."), "renv.lock")); staged.dependencies::install_deps(staged.dependencies::dependency_table(project = ".", verbose = 1), verbose = 1);' | ||
|
||
jq --arg folder "$(pwd)/" '. + { "initial_working_directory": $folder }' .devcontainer/rstudio-prefs.json > ~/.config/rstudio/rstudio-prefs.json |
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,8 @@ | ||
{ | ||
"save_workspace": "never", | ||
"always_save_history": false, | ||
"reuse_sessions_for_project_links": true, | ||
"posix_terminal_shell": "bash", | ||
"initial_working_directory": "/workspaces", | ||
"show_hidden_files": true | ||
} |
Validating CODEOWNERS rules …
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,5 @@ | ||
# This a CODEOWNERS file, where you can establish code owners. | ||
# Code owners are automatically requested for review when someone opens a pull request | ||
# that modifies code that they own. In this instance, cicdguy will be notified of any | ||
# changes made the files inside the .github/workflows directory. | ||
.github/workflows/* @cicdguy |
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,35 @@ | ||
name: Bug Report | ||
description: Something is not working correctly or is not working at all! | ||
title: "Bug: <Insert Issue Title Here>" | ||
labels: ["bug", "programming"] | ||
assignees: | ||
- octocat | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
**Example:** Bug: derive_vars_dtm() is returning NA values when using preserve argument | ||
- type: textarea | ||
id: what-happened | ||
attributes: | ||
label: What happened? | ||
description: Also tell us what were you expecting to happen before the bug? | ||
placeholder: "A bug happened!" | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: session-info | ||
attributes: | ||
label: Session Information | ||
description: Use `sessionInfo()` in the R console to gather all the details of your environment when the bug happened. | ||
placeholder: "Place the console output here" | ||
validations: | ||
required: false | ||
- type: textarea | ||
id: logs | ||
attributes: | ||
label: Reproducible Example | ||
description: We love code that can reproduce the example. Check out [reprex](https://reprex.tidyverse.org/articles/reprex-dos-and-donts.html) | ||
placeholder: "Please give us as many details as you can! The faster we can recreate the bug, the faster we can get a fix in the works. Warning, Error Messages and Screenshots are also great." | ||
validations: | ||
required: false |
Oops, something went wrong.