Skip to content

Commit

Permalink
First pass at installing less things and install apps deps on demand …
Browse files Browse the repository at this point in the history
…while testing
  • Loading branch information
schloerke committed Mar 12, 2024
1 parent 5b5ff84 commit 74ab363
Show file tree
Hide file tree
Showing 35 changed files with 781 additions and 572 deletions.
Empty file removed .Rprofile
Empty file.
49 changes: 20 additions & 29 deletions .github/internal/install-shinyverse/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,53 +40,44 @@ runs:
sudo apt-get update
sudo apt-get install -y libglpk-dev
- name: Gather remotes and app deps
id: shinyverse
shell: Rscript {0}
run: |
source("inst/gha/gha-shinyverse-packages.R")
pkgs <- shinyverse_pkgs()
message("Shinyverse packages:\n", gsub(",", ",\n", pkgs))
cat("packages=", pkgs, "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE)
- name: Rtools version
if: runner.os == 'Windows'
id: rtools-version
shell: Rscript {0}
run: |
# Get R version like `"4.2"`
short_r_version <- sub("\\.\\d$", "", "${{ inputs.r-version }}")
# For R versions >= 4.2, use Rtools v42
# Otherwise leave blank
if (
package_version("${{ inputs.r-version }}") >= package_version("4.2")
) {
message("Using Rtools v42")
cat("value=42\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE)
} else {
message("Not setting Rtools version!")
}
# - name: Rtools version
# if: runner.os == 'Windows'
# id: rtools-version
# shell: Rscript {0}
# run: |
# # Get R version like `"4.2"`
# short_r_version <- sub("\\.\\d$", "", "${{ inputs.r-version }}")
# # For R versions >= 4.2, use Rtools v42
# # Otherwise leave blank
# if (
# package_version("${{ inputs.r-version }}") >= package_version("4.2")
# ) {
# message("Using Rtools v42")
# cat("value=42\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE)
# } else {
# message("Not setting Rtools version!")
# }

- name: Adjust packages to install
id: pkgs
shell: Rscript {0}
run: |
source("inst/gha/gha-adjust-packages-to-install.R")
pkgs_to_install <- adjust_pkgs(
"${{ steps.shinyverse.outputs.packages }}",
NULL,
r_version = "${{ inputs.r-version }}"
)
message("Final packages:\n", gsub(",", ",\n", pkgs_to_install))
cat("to-install=", pkgs_to_install, "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE)
- name: Install R, shinycoreci, and shinyverse
- name: Install R and shinycoreci
uses: rstudio/shiny-workflows/setup-r-package@v1
with:
r-version: ${{ inputs.r-version }}
cache-version: ${{ inputs.cache-version }}
http-user-agent: ${{ inputs.http-user-agent }}
pandoc-version: ${{ inputs.pandoc-version }}
rtools-version: ${{ steps.rtools-version.outputs.value }}
# rtools-version: ${{ steps.rtools-version.outputs.value }}
extra-packages:
local::.
${{ steps.pkgs.outputs.to-install }}
Expand Down
9 changes: 4 additions & 5 deletions .github/shiny-workflows/package-install.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

if (!requireNamespace("digest", quietly = TRUE)) {
# Need for url remotes. See https://github.com/r-lib/actions/issues/562#issuecomment-1129088041
install.packages("digest", repos = "http://cran.us.r-project.org")
}
# if (!requireNamespace("digest", quietly = TRUE)) {
# # Need for url remotes. See https://github.com/r-lib/actions/issues/562#issuecomment-1129088041
# install.packages("digest", repos = "http://cran.us.r-project.org")
# }
2 changes: 1 addition & 1 deletion .github/workflows/apps-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
value: "ubuntu-20.04"
cache-version:
description: cache-version to be used when pulling library cache
value: "3"
value: "4"
devel:
description: Resolved r devel version
# When R 4.3 was released, R version 4.4.0 was not recognized.
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/apps-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ jobs:
with:
r-version: ${{ matrix.config.r }}
cache-version: deploy-2-${{ needs.config.outputs.cache-version }}
extra-packages: rstudio/rsconnect
# extra-packages: rstudio/rsconnect

# Perform as second step to make sure this version is installed
- name: Install shinycoreci from GitHub
shell: Rscript {0}
run: |
pak::pkg_install("rstudio/shinycoreci@${{ github.sha }}")
- name: Deploy Apps to Shinyapps.io
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/apps-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
options(repos = c(CRAN="https://cran.rstudio.com/"))
source("inst/gha/data-apps-deps-update.R")
update_apps_deps()
update_shinyverse()
- name: Display file contents
run: |
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/apps-test-os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ jobs:
status: TEST (${{ steps.short.outputs.sha }} ${{ inputs.os }} - ${{ steps.short.outputs.r-version }})
color: warning

# do not update pkgs, as they were installed above
# do update app pkgs, as they have NOT been installed
# Install packages as necessary!
- name: Run tests
timeout-minutes: 180 # 3 hrs
env:
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Description: Core shiny team tools to facilitate testing of the shiny-verse.
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Imports:
jsonlite,
progress,
Expand Down
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export(platform)
export(platform_rversion)
export(r_version_short)
export(save_test_results)
export(shinyverse_clean_libpath)
export(shinyverse_libpath)
export(shinycoreci_clean_libpaths)
export(shinycoreci_libpath)
export(test_in_browser)
export(test_in_connect)
export(test_in_ide)
Expand Down
Loading

0 comments on commit 74ab363

Please sign in to comment.