Skip to content

Commit cfc4e0a

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/main/actions/tool-cache-2.0.2
2 parents 48f02f9 + 7611e53 commit cfc4e0a

File tree

10 files changed

+142
-106
lines changed

10 files changed

+142
-106
lines changed

.github/workflows/example-10.yml

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -73,76 +73,3 @@ jobs:
7373
conda list
7474
python -VV
7575
printenv | sort
76-
77-
example-10-mambaforge:
78-
# NOTE: Mambaforge is now equivalent to Miniforge.
79-
# We are only testing this to make sure there's a smooth transition.
80-
# It should be removed once the product is definitely sunset.
81-
# prevent cronjobs from running on forks
82-
if:
83-
(github.event_name == 'schedule' && github.repository ==
84-
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule')
85-
name: Ex10 (${{ matrix.os }}, Mambaforge)
86-
runs-on: ${{ matrix.os }}-latest
87-
defaults:
88-
run:
89-
shell: bash -el {0}
90-
strategy:
91-
fail-fast: false
92-
matrix:
93-
os: ["ubuntu", "macos", "windows"]
94-
include:
95-
# should use mamba 0.7.4 to upgrade to mamba 0.7.6
96-
- os: ubuntu
97-
environment-file: etc/example-environment-no-name.yml
98-
miniforge-variant: Mambaforge
99-
miniforge-version: 4.9.2-2
100-
mamba-version: 0.7.6
101-
python-version: 3.6
102-
# should use mamba >= 0.20
103-
- os: ubuntu
104-
environment-file: etc/example-environment-no-name.yml
105-
miniforge-variant: Mambaforge
106-
mamba-version: ">=0.20"
107-
# should use mamabforge `latest`
108-
- os: windows
109-
environment-file: etc/example-explicit.Windows.conda.lock
110-
condarc-file: etc/example-condarc.yml
111-
miniforge-variant: Mambaforge
112-
- os: macos
113-
miniforge-variant: Mambaforge
114-
miniforge-version: "23.3.1-1"
115-
timeout-minutes: 30
116-
steps:
117-
- uses: actions/checkout@v4
118-
- uses: ./
119-
id: setup-miniconda
120-
with:
121-
condarc-file: ${{ matrix.condarc-file }}
122-
environment-file: ${{ matrix.environment-file }}
123-
miniforge-variant: ${{ matrix.miniforge-variant }}
124-
miniforge-version: ${{ matrix.miniforge-version }}
125-
mamba-version: ${{ matrix.mamba-version }}
126-
use-mamba: true
127-
python-version: ${{ matrix.python-version }}
128-
clean-patched-environment-file: false
129-
130-
- run: |
131-
mamba info
132-
mamba list
133-
python -VV
134-
printenv | sort
135-
- name: verify unpatched environment.yml is reported and not cleaned
136-
if: contains(matrix.environment-file, '.yml') && !matrix.python-version
137-
run: |
138-
set -eux
139-
ls '${{ steps.setup-miniconda.outputs.environment-file }}'
140-
ls '${{ matrix.environment-file }}'
141-
diff -s '${{ steps.setup-miniconda.outputs.environment-file }}' '${{ matrix.environment-file }}' | grep 'are identical'
142-
- name: verify patched output is reported, correct, and not cleaned
143-
if: contains(matrix.environment-file, '.yml') && matrix.python-version
144-
run: |
145-
set -eux
146-
if [ "$(diff '${{ steps.setup-miniconda.outputs.environment-file }}' '${{ matrix.environment-file }}' | grep -c 'python=${{ matrix.python-version }}')" -ge 1 ] ; then echo ok ; else exit 1 ; fi
147-
python --version | grep "Python ${{ matrix.python-version }}"
148-
awk '/- conda-forge/,/- defaults/' '${{ steps.setup-miniconda.outputs.environment-file }}'

.github/workflows/example-13.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
miniconda-version: latest
5151
- uses: ./
5252
if: matrix.variant == 'no-variant'
53-
id: setup-miniconda-no-variant
53+
id: setup-miniforge-no-variant
5454
continue-on-error: true
5555
with:
5656
miniforge-version: latest

.github/workflows/example-15.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: "Example 15: Linux ARM"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "*"
7+
push:
8+
branches:
9+
- "develop"
10+
- "main"
11+
- "master"
12+
schedule:
13+
# Note that cronjobs run on master/main by default
14+
- cron: "0 0 * * *"
15+
16+
jobs:
17+
example-15:
18+
# prevent cronjobs from running on forks
19+
if:
20+
(github.event_name == 'schedule' && github.repository ==
21+
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule')
22+
name: Ex15 (os=${{ matrix.os }} variant=${{ matrix.variant }})
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
os: ["ubuntu-24.04-arm"]
28+
variant: ["Miniforge3", "Miniconda", "no-variant", "empty-with"]
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: ./
32+
if: matrix.variant == 'Miniforge3'
33+
id: setup-miniforge
34+
continue-on-error: true
35+
with:
36+
auto-update-conda: true
37+
miniforge-variant: ${{ matrix.variant }}
38+
miniforge-version: latest
39+
- uses: ./
40+
if: matrix.variant == 'Miniconda'
41+
id: setup-miniconda
42+
continue-on-error: true
43+
with:
44+
auto-update-conda: true
45+
miniconda-version: latest
46+
- uses: ./
47+
if: matrix.variant == 'no-variant'
48+
id: setup-miniforge-no-variant
49+
continue-on-error: true
50+
with:
51+
miniforge-version: latest
52+
- uses: ./
53+
if: matrix.variant == 'empty-with'
54+
id: setup-miniconda-empty-with
55+
continue-on-error: true
56+
- name: Conda info
57+
shell: bash -el {0}
58+
run: conda info
59+
- name: Conda list
60+
shell: bash -el {0}
61+
run: conda list
62+
- name: Environment
63+
shell: bash -el {0}
64+
run: printenv | sort
65+
- name: Create an environment
66+
shell: bash -el {0}
67+
run: conda create -n unused --dry-run zlib
68+
- name: Run mamba
69+
if: matrix.variant == 'Miniforge3'
70+
shell: bash -el {0}
71+
run: mamba --version
72+
- name: Install Python
73+
shell: bash -el {0}
74+
run: conda install -y python
75+
- name: Check architecture
76+
shell: bash -el {0}
77+
run: |
78+
python -c "import platform; assert platform.machine() == 'aarch64', platform.machine()"

.github/workflows/example-6.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
fail-fast: false
3333
matrix:
3434
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
35-
mamba-version: ["1.5.10", "2"]
35+
mamba-version: ["1.5.*", "2"]
3636
include:
3737
- os: ubuntu-latest
3838
activate-environment: anaconda-client-env
@@ -49,13 +49,7 @@ jobs:
4949
- uses: ./
5050
with:
5151
miniforge-variant: Miniforge3
52-
# Use an old Miniforge (without conda-libmamba-solver) to allow updates to mamba v2.
53-
# Set the solver to classic for those too. This can be removed when
54-
# conda-libmamba-solver is released with libmamba v2 compatibility.
55-
miniforge-version:
56-
${{ matrix.mamba-version == '2' && '23.1.0-0' || 'latest' }}
57-
conda-solver:
58-
${{ matrix.mamba-version == '2' && 'classic' || 'libmamba' }}
52+
miniforge-version: latest
5953
python-version: "3.11"
6054
mamba-version: ${{ matrix.mamba-version }}
6155
channels: conda-forge,nodefaults

README.md

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ possibility of automatically activating the `test` environment on all shells.
5959
| [Caching packages](#caching-packages) | [![Caching Example Status][caching-badge]][caching] |
6060
| [Caching environments](#caching-environments) | [![Caching Env Example Status][caching-env-badge]][caching-env] |
6161
| [Apple Silicon](#example-13-apple-silicon) | [![Apple Silicon][ex13-badge]][ex13] |
62-
| [Remove defaults](#example-14-conda-remove-defaults) | [![Remove defaults][ex14-badge]][ex14] |
62+
| [Remove defaults](#example-14-remove-defaults-channel) | [![Remove defaults][ex14-badge]][ex14] |
63+
| [Linux ARM](#example-15-linux-arm) | [![Linux ARM][ex15-badge]][ex15] |
6364

6465
[ex1]:
6566
https://github.com/conda-incubator/setup-miniconda/actions/workflows/example-1.yml
@@ -117,6 +118,10 @@ possibility of automatically activating the `test` environment on all shells.
117118
https://github.com/conda-incubator/setup-miniconda/actions/workflows/example-14.yml
118119
[ex14-badge]:
119120
https://github.com/conda-incubator/setup-miniconda/actions/workflows/example-14.yml/badge.svg?branch=main
121+
[ex15]:
122+
https://github.com/conda-incubator/setup-miniconda/actions/workflows/example-15.yml
123+
[ex15-badge]:
124+
https://github.com/conda-incubator/setup-miniconda/actions/workflows/example-15.yml/badge.svg?branch=main
120125

121126
## Other Workflows
122127

@@ -450,10 +455,10 @@ jobs:
450455

451456
### Example 7: Lockfiles
452457

453-
`conda list --explicit` and [conda-lock][] support generating [explicit
454-
environment specifications][explicit-spec], which skip the environment solution
455-
step altogether, as they contain the _ordered_ list of exact URLs needed to
456-
reproduce the environment.
458+
`conda list --explicit` and [conda-lock][conda-lock] support generating
459+
[explicit environment specifications][explicit-spec], which skip the environment
460+
solution step altogether, as they contain the _ordered_ list of exact URLs
461+
needed to reproduce the environment.
457462

458463
This means explicitly-defined environments which:
459464

@@ -595,10 +600,10 @@ jobs:
595600
steps:
596601
- uses: actions/checkout@v4
597602
- uses: ./
598-
id: setup-miniconda
603+
id: setup-miniforge
599604
continue-on-error: true
600605
with:
601-
miniconda-version: latest
606+
miniforge-version: latest
602607
- name: Check arm64
603608
shell: bash -el {0}
604609
run: |
@@ -635,6 +640,31 @@ jobs:
635640
conda config --show-sources
636641
```
637642

643+
### Example 15: Linux ARM
644+
645+
```yaml
646+
jobs:
647+
example-15:
648+
name: Ex15 (os=${{ matrix.os }})
649+
runs-on: ${{ matrix.os }}
650+
strategy:
651+
fail-fast: false
652+
matrix:
653+
os: ["ubuntu-24.04-arm"]
654+
steps:
655+
- uses: actions/checkout@v4
656+
- uses: ./
657+
id: setup-miniconda
658+
continue-on-error: true
659+
with:
660+
miniforge-version: latest
661+
- name: Check ARM
662+
shell: bash -el {0}
663+
run: |
664+
conda install -y python
665+
python -c "import platform; assert platform.machine() == 'aarch64', platform.machine()"
666+
```
667+
638668
## Caching
639669

640670
### Caching packages

dist/delete/index.js

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup/index.js

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ export const MINICONDA_ARCHITECTURES: types.IArchitectures = {
3131
export const MINIFORGE_ARCHITECTURES: types.IArchitectures = {
3232
x64: "x86_64",
3333
x86_64: "x86_64",
34-
aarch64: "aarch64", // To be supported by github runners
34+
aarch64: "aarch64",
3535
ppc64le: "ppc64le", // To be supported by github runners
36-
arm64: "arm64", // To be supported by github runners
36+
arm64: "arm64",
3737
};
3838

3939
export const OS_NAMES: types.IOperatingSystems = {

src/input.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,14 @@ const RULES: IRule[] = [
7979
* Parse, validate, and normalize string-ish inputs from a workflow action's `with`
8080
*/
8181
export async function parseInputs(): Promise<types.IActionInputs> {
82+
let arch = core.getInput("architecture") || process.arch;
83+
if (arch === "arm64" && constants.IS_LINUX) {
84+
// https://github.com/conda-incubator/setup-miniconda/issues/385
85+
arch = "aarch64";
86+
}
8287
const inputs: types.IActionInputs = Object.freeze({
8388
activateEnvironment: core.getInput("activate-environment"),
84-
architecture: core.getInput("architecture") || process.arch,
89+
architecture: arch,
8590
condaBuildVersion: core.getInput("conda-build-version"),
8691
condaConfigFile: core.getInput("condarc-file"),
8792
condaVersion: core.getInput("conda-version"),

src/installer/download-miniconda.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ export async function downloadMiniconda(
5252
if (!arch) {
5353
throw new Error(`Invalid arch "${inputs.architecture}"!`);
5454
}
55-
// Backwards compatibility: ARM64 used to map to aarch64
56-
if (arch === "arm64" && constants.IS_LINUX) {
57-
arch = constants.MINICONDA_ARCHITECTURES["aarch64"];
58-
}
5955

6056
let extension: string = constants.IS_UNIX ? "sh" : "exe";
6157
let osName: string = constants.OS_NAMES[process.platform];

0 commit comments

Comments
 (0)