@@ -44,18 +44,20 @@ possibility of automatically activating the `test` environment on all shells.
4444
4545> Each of the examples below is discussed in a dedicated section below.
4646
47- | Documentation | Workflow Status |
48- | ----------------------------------------------- | --------------------------------------------------------------- |
49- | [ Basic usage] ( #example-1-basic-usage ) | [ ![ Basic Usage Status] [ ex1-badge ]] [ ex1 ] |
50- | [ Other shells] ( #example-2-other-shells ) | [ ![ Other Shells Status] [ ex2-badge ]] [ ex2 ] |
51- | [ Other options] ( #example-3-other-options ) | [ ![ Other Options Status] [ ex3-badge ]] [ ex3 ] |
52- | [ Channels] ( #example-4-conda-options ) | [ ![ Channels Status] [ ex4-badge ]] [ ex4 ] |
53- | [ Custom installer] ( #example-5-custom-installer ) | [ ![ Custom Installer Status] [ ex5-badge ]] [ ex5 ] |
54- | [ Mamba] ( #example-6-mamba ) | [ ![ Mamba Status] [ ex6-badge ]] [ ex6 ] |
55- | [ Lockfiles] ( #example-7-lockfiles ) | [ ![ Lockfiles Status] [ ex7-badge ]] [ ex7 ] |
56- | [ Miniforge] ( #example-10-miniforge ) | [ ![ Miniforge Status] [ ex10-badge ]] [ ex10 ] |
57- | [ Caching packages] ( #caching-packages ) | [ ![ Caching Example Status] [ caching-badge ]] [ caching ] |
58- | [ Caching environments] ( #caching-environments ) | [ ![ Caching Env Example Status] [ caching-env-badge ]] [ caching-env ] |
47+ | Documentation | Workflow Status |
48+ | ------------------------------------------------------------------ | --------------------------------------------------------------- |
49+ | [ Basic usage] ( #example-1-basic-usage ) | [ ![ Basic Usage Status] [ ex1-badge ]] [ ex1 ] |
50+ | [ Other shells] ( #example-2-other-shells ) | [ ![ Other Shells Status] [ ex2-badge ]] [ ex2 ] |
51+ | [ Other options] ( #example-3-other-options ) | [ ![ Other Options Status] [ ex3-badge ]] [ ex3 ] |
52+ | [ Channels] ( #example-4-conda-options ) | [ ![ Channels Status] [ ex4-badge ]] [ ex4 ] |
53+ | [ Custom installer] ( #example-5-custom-installer ) | [ ![ Custom Installer Status] [ ex5-badge ]] [ ex5 ] |
54+ | [ Mamba] ( #example-6-mamba ) | [ ![ Mamba Status] [ ex6-badge ]] [ ex6 ] |
55+ | [ Lockfiles] ( #example-7-lockfiles ) | [ ![ Lockfiles Status] [ ex7-badge ]] [ ex7 ] |
56+ | [ Miniforge] ( #example-10-miniforge ) | [ ![ Miniforge Status] [ ex10-badge ]] [ ex10 ] |
57+ | [ Alternative Architectures] ( #example-11-alternative-architectures ) | [ ![ Alternative Architectures] [ ex11-badge ]] [ ex11 ] |
58+ | [ Configure conda solver] ( #example-12-configure-conda-solver ) | [ ![ Configure conda solver] [ ex12-badge ]] [ ex12 ] |
59+ | [ Caching packages] ( #caching-packages ) | [ ![ Caching Example Status] [ caching-badge ]] [ caching ] |
60+ | [ Caching environments] ( #caching-environments ) | [ ![ Caching Env Example Status] [ caching-env-badge ]] [ caching-env ] |
5961
6062[ ex1] :
6163 https://github.com/conda-incubator/setup-miniconda/actions/workflows/example-1.yml
@@ -97,6 +99,14 @@ possibility of automatically activating the `test` environment on all shells.
9799 https://github.com/conda-incubator/setup-miniconda/actions/workflows/example-10.yml
98100[ ex10-badge] :
99101 https://github.com/conda-incubator/setup-miniconda/actions/workflows/example-10.yml/badge.svg?branch=main
102+ [ ex11] :
103+ https://github.com/conda-incubator/setup-miniconda/actions/workflows/example-11.yml
104+ [ ex11-badge] :
105+ https://github.com/conda-incubator/setup-miniconda/actions/workflows/example-11.yml/badge.svg?branch=main
106+ [ ex12] :
107+ https://github.com/conda-incubator/setup-miniconda/actions/workflows/example-12.yml
108+ [ ex12-badge] :
109+ https://github.com/conda-incubator/setup-miniconda/actions/workflows/example-12.yml/badge.svg?branch=main
100110
101111## Other Workflows
102112
@@ -298,7 +308,7 @@ jobs:
298308 run:
299309 shell: bash -el {0}
300310 steps:
301- - uses: actions/checkout@v2
311+ - uses: actions/checkout@v4
302312 - uses: conda-incubator/setup-miniconda@v2
303313 with:
304314 activate-environment: anaconda-client-env
@@ -330,7 +340,7 @@ jobs:
330340 run:
331341 shell: bash -el {0}
332342 steps:
333- - uses: actions/checkout@v2
343+ - uses: actions/checkout@v4
334344 - uses: conda-incubator/setup-miniconda@v2
335345 with:
336346 activate-environment: foo
@@ -372,7 +382,7 @@ jobs:
372382 run:
373383 shell: bash -el {0}
374384 steps:
375- - uses: actions/checkout@v2
385+ - uses: actions/checkout@v4
376386 - uses: conda-incubator/setup-miniconda@v2
377387 with:
378388 installer-url: https://github.com/conda-forge/miniforge/releases/download/4.8.3-2/Miniforge-pypy3-4.8.3-2-Linux-x86_64.sh
@@ -404,7 +414,7 @@ jobs:
404414 name: Ex6 Mamba
405415 runs-on: "ubuntu-latest"
406416 steps:
407- - uses: actions/checkout@v2
417+ - uses: actions/checkout@v4
408418 - uses: conda-incubator/setup-miniconda@v2
409419 with:
410420 python-version: 3.6
@@ -443,7 +453,7 @@ This means explicitly-defined environments which:
443453This approach can be useful as part of a larger system e.g., a separate workflow
444454that runs `conda-lock` for all the platforms needed in a separate job.
445455
446- [conda-lock] : https://github.com/conda-incubator /conda-lock
456+ [conda-lock] : https://github.com/conda/conda-lock
447457[explicit-spec] :
448458 https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#building-identical-conda-environments
449459
@@ -456,7 +466,7 @@ jobs:
456466 run:
457467 shell: bash -el {0}
458468 steps:
459- - uses: actions/checkout@v2
469+ - uses: actions/checkout@v4
460470 - uses: conda-incubator/setup-miniconda@v2
461471 with:
462472 auto-update-conda: false
@@ -487,7 +497,7 @@ jobs:
487497 matrix:
488498 os: ["ubuntu", "macos", "windows"]
489499 steps:
490- - uses: actions/checkout@v2
500+ - uses: actions/checkout@v4
491501 - uses: conda-incubator/setup-miniconda@v2
492502 with:
493503 environment-file: etc/example-environment.yml
@@ -519,7 +529,7 @@ jobs:
519529 condarc-file: etc/example-condarc.yml
520530 miniforge-variant: Mambaforge
521531 steps:
522- - uses: actions/checkout@v2
532+ - uses: actions/checkout@v4
523533 - uses: conda-incubator/setup-miniconda@v2
524534 with:
525535 condarc-file: ${{ matrix.condarc-file }}
@@ -549,15 +559,43 @@ jobs:
549559 architecture: ["x86"]
550560 miniconda-version: ["latest"]
551561 steps:
552- - uses: actions/checkout@v2
553- - uses: ./
562+ - uses: actions/checkout@v4
563+ - uses: conda-incubator/setup-miniconda@v2
554564 with:
555565 architecture: ${{ matrix.architecture }}
556566 miniconda-version: $${{ matrix.miniconda-version }}
557567 auto-update-conda: true
558568 python-version: "3.8"
559569` ` `
560570
571+ # ## Example 12: Configure conda solver
572+
573+ Set the conda solver plugin to use. Only applies to the `conda` client, not
574+ ` mamba` . Starting with Miniconda 23.5.2 and Miniforge 23.3.1, you can choose
575+ between `classic` and `libmamba`. Best when combined with
576+ `auto-update-conda : true`.
577+
578+ ` ` ` yaml
579+ jobs:
580+ example-12:
581+ name: Ex12 (os=${{ matrix.os }} solver=${{ matrix.solver }})
582+ runs-on: ${{ matrix.os }}
583+ strategy:
584+ fail-fast: false
585+ matrix:
586+ solver: ["classic", "libmamba"]
587+ os: ["ubuntu-latest", "windows-latest"]
588+ steps:
589+ - uses: actions/checkout@v4
590+ - uses: conda-incubator/setup-miniconda@v2
591+ id: setup-miniconda
592+ continue-on-error: true
593+ with:
594+ auto-update-conda: true
595+ conda-solver: ${{ matrix.solver }}
596+ python-version: "3.9"
597+ ` ` `
598+
561599# # Caching
562600
563601# ## Caching packages
@@ -580,9 +618,9 @@ jobs:
580618 name: Caching
581619 runs-on: "ubuntu-latest"
582620 steps:
583- - uses: actions/checkout@v2
621+ - uses: actions/checkout@v4
584622 - name: Cache conda
585- uses: actions/cache@v2
623+ uses: actions/cache@v3
586624 env:
587625 # Increase this value to reset cache if etc/example-environment.yml has not changed
588626 CACHE_NUMBER: 0
@@ -632,7 +670,7 @@ the "Get Date" step below if you use a resolved environment file product of
632670 shell: bash
633671
634672- name: Cache Conda env
635- uses: actions/cache@v2
673+ uses: actions/cache@v3
636674 with:
637675 path: ${{ env.CONDA }}/envs
638676 key:
@@ -692,7 +730,7 @@ jobs:
692730 run:
693731 shell: bash -el {0}
694732 steps:
695- - uses: actions/checkout@v2
733+ - uses: actions/checkout@v4
696734 - uses: conda-incubator/setup-miniconda@v2
697735 with:
698736 activate-environment: anaconda-client-env
@@ -737,6 +775,24 @@ jobs:
737775 defined in `environment.yaml`, otherwise the conda solver might find conflicts
738776 which cause very long install times or install failures.
739777
778+ # # Security / Reproducibility
779+
780+ Security and reproducibility is important especially when workflows deal with
781+ secrets. No matter how much individual Github action repositories are secured,
782+ git branches and tags are always mutable. It is thus good practice to :
783+
784+ 1. pin the action to a specific sha1 with tag as comment, instead of e.g. using
785+ v2 or v2.2.1 (which are mutable tags) :
786+ `uses : conda-incubator/setup-miniconda@9f54435e0e72c53962ee863144e47a4b094bfd35 # v2.3.0`
787+ see
788+ [example](https://github.com/conda-incubator/setup-miniconda/actions/workflows/caching-example.yml)
789+ 2. keep the non-human-readable pinning updated to not run behind recent updates
790+ and fixes via automation like
791+ [renovate](https://docs.renovatebot.com/modules/manager/github-actions/) or
792+ [dependabot](https://github.blog/changelog/2022-10-31-dependabot-now-updates-comments-in-github-actions-workflows-referencing-action-versions/)
793+ 3. use conda-lock files, see
794+ [conda-lock](https://github.com/conda/conda-lock#why)
795+
740796# # Project History and Contributing
741797
742798See the
@@ -745,6 +801,11 @@ for project history, or
745801[CONTRIBUTING](https://github.com/conda-incubator/setup-miniconda/blob/main/CONTRIBUTING.md)
746802to get started adding features you need.
747803
804+ # # Similar Actions to work with conda packages
805+
806+ - https://github.com/mamba-org/setup-micromamba
807+ - https://github.com/prefix-dev/setup-pixi
808+
748809# # Contributors
749810
750811Thanks to all the contributors that make this awesome project possible!
0 commit comments