https://github.com/s-weigand/setup-conda
This action adds the `conda` command from the on the worker preinstalled miniconda version to the known shell commands.
https://github.com/s-weigand/setup-conda
ci conda github-actions python setup-actions
Last synced: 6 months ago
JSON representation
This action adds the `conda` command from the on the worker preinstalled miniconda version to the known shell commands.
- Host: GitHub
- URL: https://github.com/s-weigand/setup-conda
- Owner: s-weigand
- License: apache-2.0
- Created: 2019-11-17T03:55:15.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2025-04-07T04:46:09.000Z (6 months ago)
- Last Synced: 2025-04-13T23:46:38.389Z (6 months ago)
- Topics: ci, conda, github-actions, python, setup-actions
- Language: TypeScript
- Homepage:
- Size: 1.56 MB
- Stars: 63
- Watchers: 3
- Forks: 7
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# setup-conda
[](https://github.com/s-weigand/setup-conda/actions)
[](#contributors-)This action adds the [`conda`](https://conda.io/projects/conda/en/latest/user-guide/tasks/index.html)
command from the on the worker preinstalled miniconda version to the known shell commands.> [!CAUTION]
> This action [is known to currently not work with macOS runner-images newer than `macOS-12` (i.e. `macOS-latest`)](https://github.com/s-weigand/setup-conda/issues/432).## Inputs
| Name | Requirement | Default | Description |
| ---------------- | ----------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `activate-conda` | _optional_ | `true` | Whether to activate the conda base env. |
| `update-conda` | _optional_ | `false` | If conda should be updated before running other commands. |
| `python-version` | _optional_ | `'default'` | Python version which should be installed with conda. |
| `conda-channels` | _optional_ | `''` | Additional channels like 'conda-forge', as coma separated list, which can be used to install packages. The last channel in the list, will have the highest priority. |# Usage
See [action.yml](action.yml)
## Basic:
The basic usage makes the conda python version the default python (`$ conda activate base`).
```yaml
steps:
- uses: actions/checkout@v3
- uses: s-weigand/setup-conda@v1
- run: conda --version
- run: which python
```If you don't want to change the python version which is used
(e.g. you just need to install a none python package), you can use `activate-conda: false`.```yaml
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- uses: s-weigand/setup-conda@v1
with:
activate-conda: false
- run: conda --version
- run: which python
```## Matrix Testing:
```yaml
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: [3.6, 3.7, 3.8]
name: Python ${{ matrix.python-version }} example
steps:
- uses: actions/checkout@v3
- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: anaconda, conda-forge
- run: conda --version
- run: which python
```# Similar projects
- [conda-incubator/setup-miniconda](https://github.com/conda-incubator/setup-miniconda)
- [mamba-org/setup-micromamba](https://github.com/mamba-org/setup-micromamba)
- [prefix-dev/setup-pixi](https://github.com/prefix-dev/setup-pixi)# Contributors β¨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Sebastian Weigand
π» π€ π π§ β οΈ π
Santiago Castro
π
Derrick
π
Pietro Fumiani
π
Doug
π
Filipe
π
Carl Simon Adorf
π
wvxvw
π
violafanfani
π
Oleg Broytman
π π»
LoΓ―c PaulevΓ©
π
giumas
π
JP
π
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!