Skip to content

Latest commit

 

History

History

examples

README.md

r-wasm/actions Examples

This directory contains example workflows that call r-wasm/actions's reusable workflows. Workflows should be stored in the .github/workflows directory of your repository.

Examples

On a push to the main branch on GitHub, it builds a CRAN-like repository for R WebAssembly and deploys the repo to GitHub Pages (in beta).

Great for groups and organizations using a meta GitHub repo to create a centralized R WebAssembly CRAN-like repository. Similar to CRAN, only the latest published repository version will persist.

Steps

  1. Checkout the GitHub repository
  2. Build the repository with r-wasm/actions/build-cran-repo
  3. Deploy the repository to GitHub pages with actions/upload-pages-artifact

Inputs available

  • packages ('packages') - A string of R package references. If an empty value is provided (default), the workflow will read ./packages file for the R package references.
  • compress (true) - Compress Emscripten VFS images. Defaults to true. Loading compressed VFS images requires at least version 0.4.1 of webR.

Usage

To leverage this reusable workflow, run the following R command in the root of your GitHub repository:

usethis::use_github_action(
  url = "https://raw.githubusercontent.com/r-wasm/actions/v3/examples/deploy-cran-repo.yml"
)

On a published GitHub release, it builds a WebAssembly file image and adds the files to a GitHub release.

This is typically used within R packages to build and release a WebAssembly R package library image of your package and its dependencies. Because the assets are tied to a release, they will never be overwritten are are stable over time.

Steps

  1. Checkout the GitHub repository
  2. Build the library image with r-wasm/actions/build-cran-repo
  3. Add the library image to the release with svenstaro/upload-release-action

Inputs available

  • packages ('.') - A string of R package references.
  • strip (NULL) - An R expression evaluating to a character vector of directories to remove when building the WebAssembly R package library image. To achieve a smaller bundle size, it is recommended to set strip to c("demo", "doc", "examples", "help", "html", "include", "tests", "vignette").
  • compress (true) - Compress Emscripten VFS images. Defaults to true. Loading compressed VFS images requires at least version 0.4.1 of webR.

Usage

To leverage this reusable workflow, run the following R command in the root of your GitHub repository:

usethis::use_github_action(
  url = "https://raw.githubusercontent.com/r-wasm/actions/v3/examples/release-file-system-image.yml"
)