-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
renv / codespaces update from pharmaverse/admiralci
- Loading branch information
1 parent
298aebc
commit c6c5b43
Showing
5 changed files
with
250 additions
and
12 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 |
---|---|---|
@@ -1,16 +1,15 @@ | ||
# Set renv profile base on R version. | ||
renv_profile <- paste(R.version$major, substr(R.version$minor, 1, 1), sep = ".") | ||
if (file.exists("./renv/profile")) { | ||
message("Using renv profile from `renv/profile` file.") | ||
} else if (renv_profile %in% c("4.1", "4.2", "4.3")) { | ||
message("Set renv profile to `", renv_profile, "`") | ||
Sys.setenv("RENV_PROFILE" = renv_profile) | ||
if ((Sys.getenv("GITHUB_ACTIONS") == "") && (Sys.getenv("DOCKER_CONTAINER_CONTEXT") == "")) { | ||
renv_profile <- paste(R.version$major, substr(R.version$minor, 1, 1), sep = ".") | ||
if (file.exists("./renv/profile")) { | ||
message("Using renv profile from `renv/profile` file.") | ||
} else 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.") | ||
} | ||
source("renv/activate.R") | ||
} else { | ||
message("This repository do not contains the renv profile for your R version.") | ||
} | ||
|
||
if ((Sys.getenv("GITHUB_ACTIONS") != "") || (Sys.getenv("DOCKER_CONTAINER_CONTEXT") != "")) { | ||
options(repos = c(CRAN = "https://cran.rstudio.com")) | ||
Sys.setenv(RENV_AUTOLOADER_ENABLED=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,77 @@ | ||
{ | ||
// 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" | ||
}, | ||
"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": true, | ||
"installOhMyZsh": true, | ||
"username": "rstudio", | ||
"upgradePackages": false | ||
|
||
}, | ||
"ghcr.io/mikaello/devcontainer-features/modern-shell-utils:1": {} | ||
}, | ||
"init": true, | ||
"overrideCommand": false, | ||
|
||
"postCreateCommand": { | ||
"renv": "R -q -e 'renv::activate(profile = \"4.1\"); renv::restore(); staged.dependencies::install_deps(staged.dependencies::dependency_table(project = \".\", verbose = 1), verbose = 1);'", | ||
"rstudio": "jq --arg folder \"$(pwd)/\" '. + { \"initial_working_directory\": $folder }' .devcontainer/rstudio-prefs.json > ~/.config/rstudio/rstudio-prefs.json" | ||
}, | ||
|
||
"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": "ignore" | ||
} | ||
}, | ||
// 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,77 @@ | ||
{ | ||
// 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" | ||
}, | ||
"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": true, | ||
"installOhMyZsh": true, | ||
"username": "rstudio", | ||
"upgradePackages": false | ||
|
||
}, | ||
"ghcr.io/mikaello/devcontainer-features/modern-shell-utils:1": {} | ||
}, | ||
"init": true, | ||
"overrideCommand": false, | ||
|
||
"postCreateCommand": { | ||
"renv": "R -q -e 'renv::activate(profile = \"4.2\"); renv::restore(); staged.dependencies::install_deps(staged.dependencies::dependency_table(project = \".\", verbose = 1), verbose = 1);'", | ||
"rstudio": "jq --arg folder \"$(pwd)/\" '. + { \"initial_working_directory\": $folder }' .devcontainer/rstudio-prefs.json > ~/.config/rstudio/rstudio-prefs.json" | ||
}, | ||
|
||
"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": "ignore" | ||
} | ||
}, | ||
// 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,77 @@ | ||
{ | ||
// 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", | ||
"DOCKER_CONTAINER_CONTEXT": "" | ||
}, | ||
"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": true, | ||
"installOhMyZsh": true, | ||
"username": "rstudio", | ||
"upgradePackages": false | ||
}, | ||
"ghcr.io/mikaello/devcontainer-features/modern-shell-utils:1": {} | ||
}, | ||
"init": true, | ||
"overrideCommand": false, | ||
|
||
"postCreateCommand": { | ||
"renv": "R -q -e 'renv::activate(profile = \"4.3\"); renv::restore(); staged.dependencies::install_deps(staged.dependencies::dependency_table(project = \".\", verbose = 1), verbose = 1);'", | ||
"rstudio": "jq --arg folder \"$(pwd)/\" '. + { \"initial_working_directory\": $folder }' .devcontainer/rstudio-prefs.json > ~/.config/rstudio/rstudio-prefs.json" | ||
}, | ||
|
||
"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": "ignore" | ||
} | ||
}, | ||
// 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,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 | ||
} |