Skip to content
code

GitHub Action

setup-conda

v1.2.3 Latest version

setup-conda

code

setup-conda

Setup conda to use in later actions

Installation

Copy and paste the following snippet into your .yml file.

              

- name: setup-conda

uses: s-weigand/setup-conda@v1.2.3

Learn more about this action in s-weigand/setup-conda

Choose a version

setup-conda

Tests All Contributors

This action adds the conda command from the on the worker preinstalled miniconda version to the known shell commands.

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

Basic:

The basic usage makes the conda python version the default python ($ conda activate base).

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.

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:

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

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

Sebastian Weigand
Sebastian Weigand

๐Ÿ’ป ๐Ÿค” ๐Ÿš‡ ๐Ÿšง โš ๏ธ ๐Ÿ‘€
Santiago Castro
Santiago Castro

๐Ÿ“–
Derrick
Derrick

๐Ÿ“–
Pietro Fumiani
Pietro Fumiani

๐Ÿ›
Doug
Doug

๐Ÿ›
Filipe
Filipe

๐Ÿ›
Carl Simon Adorf
Carl Simon Adorf

๐Ÿ›
wvxvw
wvxvw

๐Ÿ›
violafanfani
violafanfani

๐Ÿ›
Oleg Broytman
Oleg Broytman

๐Ÿ› ๐Ÿ’ป
Loรฏc Paulevรฉ
Loรฏc Paulevรฉ

๐Ÿ›
giumas
giumas

๐Ÿ›

This project follows the all-contributors specification. Contributions of any kind welcome!