Skip to content

Commit

Permalink
Add cli for use in NPM scripts
Browse files Browse the repository at this point in the history
When used in NPM scripts, `setup-micromamba` provides a convenient way to
download micromamba and create conda environments.

Set options through environment variables in invocation. If micromamba has
already been downloaded or an environment already exists, it will not be
recreated.

Example:

```
  "scripts": {
  [...]
    "micromamba": "MICROMAMBA_ROOT_PATH=micromamba CREATE_ENVIRONMENT=true CREATE_ARGS=\"python=3.11\" ENVIRONMENT_NAME=test-env setup-micromamba",
  [...]
```

We re-use the mocking core. Determination of the core backend is moved
to a separate module to prevent duplication and circular imports.

The default micromamba bin path is set to
`${MICROMAMBA_ROOT_PATH}/micromamba` if `MICROMAMBA_ROOT_PATH` is set.

Have the mocking core respect the log level.
  • Loading branch information
thewtex committed Oct 30, 2023
1 parent db1df3b commit 4e6483b
Show file tree
Hide file tree
Showing 15 changed files with 88,773 additions and 4,641 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

GitHub Action to set up the [micromamba](https://github.com/mamba-org/mamba#micromamba) package manager.

Also useful to download micromamba and create conda environments in npm
scripts.

## Usage

```yml
Expand Down Expand Up @@ -339,6 +342,24 @@ For further information, see
[`jobs.<job_id>.steps[*].shell`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell)
and [this thread](https://github.com/orgs/community/discussions/25061).

## Use in NPM scripts

When used in NPM scripts, `setup-micromamba` provides a convenient way to
download micromamba and create conda environments.

Set options through environment variables in invocation. If micromamba has
already been downloaded or an environment already exists, it will not be
recreated.

Example:

```
"scripts": {
[...]
"micromamba": "MICROMAMBA_ROOT_PATH=micromamba CREATE_ENVIRONMENT=true CREATE_ARGS=\"python=3.11\" ENVIRONMENT_NAME=test-env setup-micromamba",
[...]
```

## Development

1. Clone this repository.
Expand Down
Loading

0 comments on commit 4e6483b

Please sign in to comment.