Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

setup-bonsai

Action for bootstrapping Bonsai environments from GitHub Actions workflows.

To help speed up your CI, this action will (by default) automatically cache the Bonsai packages used to restore your environments using the GitHub Actions cache.

This action also handles injecting packages into Bonsai environments, which allows you to consume freshly built packages straight from the rest of your CI pipeline.

Usage

Basic usage is to simply invoke the action to install bootstrap the .bonsai environment at the root of your repository:

- name: Set up Bonsai environment
  uses: bonsai-rx/setup-bonsai@v2

Specifying the environment(s) to restore

You can specify the one or more Bonsai environments to restore using the environment-paths parameter:

- name: Set up Bonsai environments
  uses: bonsai-rx/setup-bonsai@v2
  with:
    environment-paths: |
      .bonsai/
      docs/examples/.bonsai/

Note that when possible it is preferred to pass multiple environments to a single setup-bonsai over invoking setup-bonsai multiple times. (See this issue for details.)

You can also use glob syntax to select multiple environments at once.

This example restores all environments across the entire repo:

- name: Set up Bonsai environments
  uses: bonsai-rx/setup-bonsai@v2
  with:
    environment-paths: **/.bonsai/

Injecting packages

You can inject one or more .nupkg files into your Bonsai environment using the inject-packages parameter. Their dependencies will automatically be installed as well.

- name: Download built packages
  uses: actions/download-artifact@v4
  with:
    name: Packages
    path: artifacts/packages/

- name: Set up Bonsai environment
  uses: bonsai-rx/setup-bonsai@v2
  with:
    inject-packages: artifacts/packages/*.nupkg

An environment that depends on one of the injected packages can be bootstrapped even when that package is not yet published. The initial bootstrap is allowed to fail and is then completed by the injection step, which supports co-developing an examples repository alongside unreleased packages.

Injected packages (and their dependencies not already present in Bonsai.config) are excluded from the package cache to avoid any cache poisoning issues.

(Specifically, the action captures the packages to be cached before the injected packages are even added to Bonsai.config.)

Documentation

See action.yml for a full list of input parameters and outputs supported by this action.

See the documentation folder for advanced documentation.

About

Action for bootstrapping Bonsai environments from GitHub Actions workflows

Topics

Resources

Code of conduct

Stars

0 stars

Watchers

3 watching

Forks

Releases

Used by

Contributors

Languages