@@ -44,18 +44,20 @@ possibility of automatically activating the `test` environment on all shells.
44
44
45
45
> Each of the examples below is discussed in a dedicated section below.
46
46
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 ] |
59
61
60
62
[ ex1] :
61
63
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.
97
99
https://github.com/conda-incubator/setup-miniconda/actions/workflows/example-10.yml
98
100
[ ex10-badge] :
99
101
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
100
110
101
111
## Other Workflows
102
112
@@ -298,7 +308,7 @@ jobs:
298
308
run:
299
309
shell: bash -el {0}
300
310
steps:
301
- - uses: actions/checkout@v2
311
+ - uses: actions/checkout@v4
302
312
- uses: conda-incubator/setup-miniconda@v2
303
313
with:
304
314
activate-environment: anaconda-client-env
@@ -330,7 +340,7 @@ jobs:
330
340
run:
331
341
shell: bash -el {0}
332
342
steps:
333
- - uses: actions/checkout@v2
343
+ - uses: actions/checkout@v4
334
344
- uses: conda-incubator/setup-miniconda@v2
335
345
with:
336
346
activate-environment: foo
@@ -372,7 +382,7 @@ jobs:
372
382
run:
373
383
shell: bash -el {0}
374
384
steps:
375
- - uses: actions/checkout@v2
385
+ - uses: actions/checkout@v4
376
386
- uses: conda-incubator/setup-miniconda@v2
377
387
with:
378
388
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:
404
414
name: Ex6 Mamba
405
415
runs-on: "ubuntu-latest"
406
416
steps:
407
- - uses: actions/checkout@v2
417
+ - uses: actions/checkout@v4
408
418
- uses: conda-incubator/setup-miniconda@v2
409
419
with:
410
420
python-version: 3.6
@@ -443,7 +453,7 @@ This means explicitly-defined environments which:
443
453
This approach can be useful as part of a larger system e.g., a separate workflow
444
454
that runs `conda-lock` for all the platforms needed in a separate job.
445
455
446
- [conda-lock] : https://github.com/conda-incubator /conda-lock
456
+ [conda-lock] : https://github.com/conda/conda-lock
447
457
[explicit-spec] :
448
458
https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#building-identical-conda-environments
449
459
@@ -456,7 +466,7 @@ jobs:
456
466
run:
457
467
shell: bash -el {0}
458
468
steps:
459
- - uses: actions/checkout@v2
469
+ - uses: actions/checkout@v4
460
470
- uses: conda-incubator/setup-miniconda@v2
461
471
with:
462
472
auto-update-conda: false
@@ -487,7 +497,7 @@ jobs:
487
497
matrix:
488
498
os: ["ubuntu", "macos", "windows"]
489
499
steps:
490
- - uses: actions/checkout@v2
500
+ - uses: actions/checkout@v4
491
501
- uses: conda-incubator/setup-miniconda@v2
492
502
with:
493
503
environment-file: etc/example-environment.yml
@@ -519,7 +529,7 @@ jobs:
519
529
condarc-file: etc/example-condarc.yml
520
530
miniforge-variant: Mambaforge
521
531
steps:
522
- - uses: actions/checkout@v2
532
+ - uses: actions/checkout@v4
523
533
- uses: conda-incubator/setup-miniconda@v2
524
534
with:
525
535
condarc-file: ${{ matrix.condarc-file }}
@@ -549,15 +559,43 @@ jobs:
549
559
architecture: ["x86"]
550
560
miniconda-version: ["latest"]
551
561
steps:
552
- - uses: actions/checkout@v2
553
- - uses: ./
562
+ - uses: actions/checkout@v4
563
+ - uses: conda-incubator/setup-miniconda@v2
554
564
with:
555
565
architecture: ${{ matrix.architecture }}
556
566
miniconda-version: $${{ matrix.miniconda-version }}
557
567
auto-update-conda: true
558
568
python-version: "3.8"
559
569
` ` `
560
570
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
+
561
599
# # Caching
562
600
563
601
# ## Caching packages
@@ -580,9 +618,9 @@ jobs:
580
618
name: Caching
581
619
runs-on: "ubuntu-latest"
582
620
steps:
583
- - uses: actions/checkout@v2
621
+ - uses: actions/checkout@v4
584
622
- name: Cache conda
585
- uses: actions/cache@v2
623
+ uses: actions/cache@v3
586
624
env:
587
625
# Increase this value to reset cache if etc/example-environment.yml has not changed
588
626
CACHE_NUMBER: 0
@@ -632,7 +670,7 @@ the "Get Date" step below if you use a resolved environment file product of
632
670
shell: bash
633
671
634
672
- name: Cache Conda env
635
- uses: actions/cache@v2
673
+ uses: actions/cache@v3
636
674
with:
637
675
path: ${{ env.CONDA }}/envs
638
676
key:
@@ -692,7 +730,7 @@ jobs:
692
730
run:
693
731
shell: bash -el {0}
694
732
steps:
695
- - uses: actions/checkout@v2
733
+ - uses: actions/checkout@v4
696
734
- uses: conda-incubator/setup-miniconda@v2
697
735
with:
698
736
activate-environment: anaconda-client-env
@@ -737,6 +775,24 @@ jobs:
737
775
defined in `environment.yaml`, otherwise the conda solver might find conflicts
738
776
which cause very long install times or install failures.
739
777
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
+
740
796
# # Project History and Contributing
741
797
742
798
See the
@@ -745,6 +801,11 @@ for project history, or
745
801
[CONTRIBUTING](https://github.com/conda-incubator/setup-miniconda/blob/main/CONTRIBUTING.md)
746
802
to get started adding features you need.
747
803
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
+
748
809
# # Contributors
749
810
750
811
Thanks to all the contributors that make this awesome project possible!
0 commit comments