Skip to content

Commit

Permalink
Install things as necessary from shinycoreci r-universe (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
schloerke authored May 17, 2024
1 parent 4c0b672 commit 2bdb36e
Show file tree
Hide file tree
Showing 48 changed files with 961 additions and 847 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
^todo\.md$

^inst/apps/.*/tests/.*
^inst/apps/\.renvignore$
\.jshintrc$
www/nvd3/deprecated
^_pkgdown\.yml$
Expand Down
Empty file removed .Rprofile
Empty file.
46 changes: 2 additions & 44 deletions .github/internal/install-shinyverse/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ inputs:
required: false
pandoc-version:
description: Pandoc version to pass through
default: "2.7.3"
default: "3.x"
required: false
runs:
using: "composite"
Expand All @@ -40,54 +40,12 @@ 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: 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 }}",
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 }}
extra-packages:
local::.
${{ steps.pkgs.outputs.to-install }}
${{ inputs.extra-packages }}
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: "5"
devel:
description: Resolved r devel version
# When R 4.3 was released, R version 4.4.0 was not recognized.
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/apps-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ jobs:
retry: 3
# extra_app_text: ", apps = c('000-all', '000-manual', '300-bs-themer')"

## Deployment server has been disabled
- os: "${{ needs.config.outputs.ubuntu }}"
r: "${{ needs.config.outputs.oldrel1 }}"
type: "connect"
account: "barret"
server_name: "rsc.radixu.com"
server_url: "https://rsc.radixu.com/__api__"
# rspm: "https://demo.rstudiopm.com/all/__linux__/focal/latest"
cores: 1
retry: 3
# extra_app_text: ", apps = c('000-all', '000-manual', '300-bs-themer')"
Expand All @@ -56,7 +54,7 @@ jobs:
# RSPM: ${{ matrix.config.rspm }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: GitHub Pull

- name: R Options
Expand All @@ -65,12 +63,11 @@ jobs:
echo 'MAKEFLAGS=-j2' >> .Renviron
- name: Install R, shinycoreci, and shinyverse
timeout-minutes: 45
timeout-minutes: 30 # Should be < 10 mins
uses: ./.github/internal/install-shinyverse
with:
r-version: ${{ matrix.config.r }}
cache-version: deploy-2-${{ needs.config.outputs.cache-version }}
extra-packages: rstudio/rsconnect

# Perform as second step to make sure this version is installed
- name: Install shinycoreci from GitHub
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/apps-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ jobs:
steps:
- name: GitHub Pull (PR)
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# check out the commit sha, not the merged sha. Avoids the "Merge SHA_A into SHA_B" into commits
ref: ${{ github.event.pull_request.head.sha }} # # Ref: https://github.com/actions/checkout/pull/115/files#diff-04c6e90faac2675aa89e2176d2eec7d8R203-R209
fetch-depth: 0
- name: GitHub Pull (Branch)
if: github.event_name != 'pull_request'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/apps-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
echo "sha: $SHORT_SHA"
echo "sha=$SHORT_SHA" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: steps.can-build.conclusion != 'skipped'

- name: Log in to the Container registry
Expand Down
107 changes: 25 additions & 82 deletions .github/workflows/apps-test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,184 +25,127 @@ jobs:
uses: ./.github/workflows/apps-config.yml

macos-release:
if: ${{ ! cancelled() }}
needs: [config, ubuntu-release]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.release }}
os: ${{ needs.config.outputs.macos }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
macos-oldrel-1:
if: ${{ ! cancelled() }}
needs: [config, ubuntu-oldrel-1]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.oldrel1 }}
os: ${{ needs.config.outputs.macos }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
macos-oldrel-2:
if: ${{ ! cancelled() }}
needs: [config, ubuntu-oldrel-2]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.oldrel2 }}
os: ${{ needs.config.outputs.macos }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
macos-oldrel-3:
if: ${{ ! cancelled() }}
needs: [config, ubuntu-oldrel-3]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.oldrel3 }}
os: ${{ needs.config.outputs.macos }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
macos-oldrel-4:
if: ${{ ! cancelled() }}
needs: [config, ubuntu-oldrel-4]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.oldrel4 }}
os: ${{ needs.config.outputs.macos }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

ubuntu-release:
needs: [precheck, config]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.release }}
os: ${{ needs.config.outputs.ubuntu }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
ubuntu-oldrel-1:
needs: [precheck, config]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.oldrel1 }}
os: ${{ needs.config.outputs.ubuntu }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
ubuntu-oldrel-2:
needs: [precheck, config]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.oldrel2 }}
os: ${{ needs.config.outputs.ubuntu }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
ubuntu-oldrel-3:
needs: [precheck, config]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.oldrel3 }}
os: ${{ needs.config.outputs.ubuntu }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
ubuntu-oldrel-4:
needs: [precheck, config]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.oldrel4 }}
os: ${{ needs.config.outputs.ubuntu }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

windows-release:
if: ${{ ! cancelled() }}
needs: [config, macos-release]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.release }}
os: ${{ needs.config.outputs.windows }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
windows-oldrel-1:
if: ${{ ! cancelled() }}
needs: [config, macos-oldrel-1]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.oldrel1 }}
os: ${{ needs.config.outputs.windows }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
windows-oldrel-2:
if: ${{ ! cancelled() }}
needs: [config, macos-oldrel-2]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.oldrel2 }}
os: ${{ needs.config.outputs.windows }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
windows-oldrel-3:
if: ${{ ! cancelled() }}
needs: [config, macos-oldrel-3]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.oldrel3 }}
os: ${{ needs.config.outputs.windows }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
windows-oldrel-4:
if: ${{ ! cancelled() }}
needs: [config, macos-oldrel-4]
needs: [config]
uses: ./.github/workflows/apps-test-os.yml
with:
r-version: ${{ needs.config.outputs.oldrel4 }}
os: ${{ needs.config.outputs.windows }}
cache-version: ${{ needs.config.outputs.cache-version }}
secrets:
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

build-results:
uses: ./.github/workflows/build-results.yml
if: ${{ (! cancelled()) && (github.event_name != 'pull_request') }}
needs:
## Comment for now to reduce requirements as we know the last round is windows
# - macos-release
# - macos-oldrel-1
# - macos-oldrel-2
# - macos-oldrel-3
# - macos-oldrel-4
- macos-release
- macos-oldrel-1
- macos-oldrel-2
- macos-oldrel-3
- macos-oldrel-4

# - ubuntu-release
# - ubuntu-oldrel-1
# - ubuntu-oldrel-2
# - ubuntu-oldrel-3
# - ubuntu-oldrel-4
- ubuntu-release
- ubuntu-oldrel-1
- ubuntu-oldrel-2
- ubuntu-oldrel-3
- ubuntu-oldrel-4

- windows-release
- windows-oldrel-1
Expand Down
Loading

0 comments on commit 2bdb36e

Please sign in to comment.