Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use setup-r-dependencies action #279

Merged
merged 15 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 30 additions & 5 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,59 @@ jobs:
if: github.event_name != 'push'
name: Audit Dependencies 🕵️‍♂️
uses: insightsengineering/r.pkg.template/.github/workflows/audit.yaml@main
r-cmd:
r-cmd-dev:
if: github.event_name != 'push'
name: R CMD Check (development) 🧬
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@bci_params
pawelru marked this conversation as resolved.
Show resolved Hide resolved
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
with:
install-deps-from-package-repositories: "R-universe=https://pharmaverse.r-universe.dev/,CRAN=https://cloud.r-project.org/"
package-subdirectory: package
additional-env-vars: |
NOT_CRAN=true
QUARTO_PROFILE=development
TLG_CATALOG_PKG_BUILD_RENDER=TRUE
concurrency-group: development
deps-installation-method: setup-r-dependencies
lookup-refs: |
insightsengineering/random.cdisc.data
insightsengineering/formatters
insightsengineering/rlistings
insightsengineering/rtables
insightsengineering/tern
insightsengineering/tern.mmrm
insightsengineering/tern.rbmi
insightsengineering/teal.data
insightsengineering/teal.code
insightsengineering/teal.logger
insightsengineering/teal.reporter
insightsengineering/teal.slice
insightsengineering/teal.transform
insightsengineering/teal.widgets
insightsengineering/teal
insightsengineering/teal.modules.general
insightsengineering/teal.modules.clinical
skip-desc-dev: true
pawelru marked this conversation as resolved.
Show resolved Hide resolved
repository-list: "https://pharmaverse.r-universe.dev/, PPM@latest"
pawelru marked this conversation as resolved.
Show resolved Hide resolved
cache-version: "dev"
r-cmd-stable:
if: github.event_name != 'push'
name: R CMD Check (stable) 🧬
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@main
uses: insightsengineering/r.pkg.template/.github/workflows/build-check-install.yaml@bci_params
pawelru marked this conversation as resolved.
Show resolved Hide resolved
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
with:
install-deps-from-package-repositories: "R-universe=https://insightsengineering.r-universe.dev/,CRAN=https://cloud.r-project.org/"
package-subdirectory: package
additional-env-vars: |
NOT_CRAN=true
QUARTO_PROFILE=stable
TLG_CATALOG_PKG_BUILD_RENDER=TRUE
concurrency-group: stable
deps-installation-method: setup-r-dependencies
skip-desc-dev: true
skip-desc-branch: true
repository-list: "https://insightsengineering.r-universe.dev/, PPM@latest"
pawelru marked this conversation as resolved.
Show resolved Hide resolved
cache-version: "stable"
linter:
if: github.event_name != 'push'
name: SuperLinter 🦸‍♀️
Expand Down
96 changes: 50 additions & 46 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
push:
branches:
- main
- use_setup_r_deps
pawelru marked this conversation as resolved.
Show resolved Hide resolved
schedule:
- cron: "17 17 * * 3,6"

Expand Down Expand Up @@ -61,7 +62,6 @@ jobs:
uses: actions/cache@v4
with:
path: |
~/package/.staged.dependencies
book/_freeze
key: ${{ runner.os }}-tlg-catalog-dev

Expand All @@ -70,14 +70,15 @@ jobs:
echo "gchat_webhook=${{ secrets.GCHAT_WEBHOOK }}" >> $GITHUB_ENV
shell: bash

- name: Run Staged dependencies 🎦
uses: insightsengineering/staged-dependencies-action@v1
env:
GITHUB_PAT: ${{ secrets.REPO_GITHUB_TOKEN }}
- name: Setup R dependencies 🎦
uses: insightsengineering/setup-r-dependencies@named_repos
pawelru marked this conversation as resolved.
Show resolved Hide resolved
with:
path: "./package"
enable-check: false
direction: upstream
github-token: ${{ secrets.REPO_GITHUB_TOKEN }}
pawelru marked this conversation as resolved.
Show resolved Hide resolved
repository-path: "./package"
skip-desc-branch: true
skip-desc-dev: true
repository-list: "https://pharmaverse.r-universe.dev/, PPM@latest"
pawelru marked this conversation as resolved.
Show resolved Hide resolved
cache-version: "dev"

- name: Render catalog 🖨
run: |
Expand All @@ -98,7 +99,7 @@ jobs:
with:
name: site-development
path: site.zip

- name: Remove large WebR assets 🧹
run: |
packages_path <- sprintf("./book/_site/site_libs/quarto-contrib/shinylive-%s/shinylive/webr/packages", shinylive::assets_version())
Expand All @@ -112,28 +113,28 @@ jobs:
unlink(x, recursive = TRUE)
}
}

# refresh the `metadata.rds` file
metadata_path <- file.path(packages_path, "metadata.rds")
metadata <- readRDS(metadata_path)
new_metadata <- metadata[intersect(names(metadata), list.dirs(packages_path, full.names = FALSE))]
saveRDS(new_metadata, metadata_path)
saveRDS(new_metadata, metadata_path)
shell: Rscript {0}

- name: Publish docs 📔
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/_site
destination_dir: development
#- name: Publish docs 📔
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./book/_site
# destination_dir: development
pawelru marked this conversation as resolved.
Show resolved Hide resolved

- name: GChat notification 🔔
if: (failure() || cancelled()) && env.gchat_webhook != ''
uses: insightsengineering/google-chat-notification@master
with:
name: ${{ github.event.repository.name }} - development
url: ${{ secrets.GCHAT_WEBHOOK }}
status: ${{ job.status }}
#- name: GChat notification 🔔
# if: (failure() || cancelled()) && env.gchat_webhook != ''
# uses: insightsengineering/google-chat-notification@master
# with:
# name: ${{ github.event.repository.name }} - development
# url: ${{ secrets.GCHAT_WEBHOOK }}
# status: ${{ job.status }}
pawelru marked this conversation as resolved.
Show resolved Hide resolved

publish-stable:
name: Build & Deploy TLGC (stable) 📖
Expand Down Expand Up @@ -161,11 +162,15 @@ jobs:
echo "gchat_webhook=${{ secrets.GCHAT_WEBHOOK }}" >> $GITHUB_ENV
shell: bash

- name: Install packages 🎦
run: |
devtools::install_dev_deps(".", repos = c("https://insightsengineering.r-universe.dev/", "https://cloud.r-project.org/"))
shell: Rscript {0}
working-directory: package
- name: Setup R dependencies 🎦
uses: insightsengineering/setup-r-dependencies@named_repos
pawelru marked this conversation as resolved.
Show resolved Hide resolved
with:
github-token: ${{ secrets.REPO_GITHUB_TOKEN }}
repository-path: "./package"
skip-desc-branch: true
skip-desc-dev: true
repository-list: "https://insightsengineering.r-universe.dev/, PPM@latest"
pawelru marked this conversation as resolved.
Show resolved Hide resolved
cache-version: "stable"

- name: Render catalog 🖨
run: |
Expand All @@ -179,7 +184,7 @@ jobs:
zip -r9 ../../site.zip *
shell: bash
working-directory: book/_site

- name: Remove large WebR assets 🧹
run: |
packages_path <- sprintf("./book/_site/site_libs/quarto-contrib/shinylive-%s/shinylive/webr/packages", shinylive::assets_version())
Expand All @@ -193,36 +198,35 @@ jobs:
unlink(x, recursive = TRUE)
}
}

# refresh the `metadata.rds` file
metadata_path <- file.path(packages_path, "metadata.rds")
metadata <- readRDS(metadata_path)
new_metadata <- metadata[intersect(names(metadata), list.dirs(packages_path, full.names = FALSE))]
saveRDS(new_metadata, metadata_path)
saveRDS(new_metadata, metadata_path)
shell: Rscript {0}


- name: Upload docs ⬆
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: site-stable
path: site.zip

- name: Publish docs 📔
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/_site
destination_dir: stable
#- name: Publish docs 📔
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./book/_site
# destination_dir: stable
pawelru marked this conversation as resolved.
Show resolved Hide resolved

- name: GChat notification 🔔
if: (failure() || cancelled()) && env.gchat_webhook != ''
uses: insightsengineering/google-chat-notification@master
with:
name: ${{ github.event.repository.name }} - stable
url: ${{ secrets.GCHAT_WEBHOOK }}
status: ${{ job.status }}
#- name: GChat notification 🔔
# if: (failure() || cancelled()) && env.gchat_webhook != ''
# uses: insightsengineering/google-chat-notification@master
# with:
# name: ${{ github.event.repository.name }} - stable
# url: ${{ secrets.GCHAT_WEBHOOK }}
# status: ${{ job.status }}
pawelru marked this conversation as resolved.
Show resolved Hide resolved

upload-release-assets:
name: Upload assets 🔼
Expand Down
4 changes: 2 additions & 2 deletions book/_extensions/coatless/webr/_extension.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: webr
title: Embedded webr code cells
author: James Joseph Balamuta
version: 0.4.2-dev.3
quarto-required: ">=1.2.198"
version: 0.4.3-dev.2
quarto-required: ">=1.4.554"
contributes:
filters:
- webr.lua
4 changes: 4 additions & 0 deletions book/_extensions/coatless/webr/qwebr-cell-initialization.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ qwebrInstance.then(
break;
case 'setup':
const activeDiv = document.getElementById(`qwebr-noninteractive-setup-area-${qwebrCounter}`);

// Store code in history
qwebrLogCodeToHistory(cellCode, entry.options);

// Run the code in a non-interactive state with all output thrown away
await mainWebR.evalRVoid(`${cellCode}`);
break;
Expand Down
Loading
Loading