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 Dec 6, 2023
1 parent 8752438 commit 0f951b3
Show file tree
Hide file tree
Showing 15 changed files with 89,213 additions and 4,815 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 @@ -367,6 +370,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 0f951b3

Please sign in to comment.