Skip to content

Commit

Permalink
Merge pull request #296 from marcoesters/miniconda-architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
goanpeca authored Nov 14, 2023
2 parents d0116ee + 287aca3 commit 5830a04
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,7 @@ jobs:
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://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#custom-shell)
and
[thread](https://github.com/orgs/community/discussions/25061).
and [thread](https://github.com/orgs/community/discussions/25061).
- Sh shells do not use `~/.profile` or `~/.bashrc` so these shells need to be
explicitely declared as `shell: sh -l {0}` on steps that need to be properly
activated (or use a default shell). This is because sh shells are executed
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ inputs:
default: ""
architecture:
description:
'Architecture of Miniconda that should be installed. Available options on
GitHub-hosted runners are "x86" and "x64". Default is "x64".'
'Architecture of Miniconda that should be installed. Default is "x64". The
CPU architecture of the runner is not detected by the workflow.'
required: false
default: "x64"
clean-patched-environment-file:
Expand Down
8 changes: 6 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ export const MINICONDA_BASE_URL: string =

/** Processor architectures supported by Miniconda */
export const MINICONDA_ARCHITECTURES: types.IArchitectures = {
aarch64: "aarch64",
arm64: "arm64",
ppc64le: "ppc64le",
s390x: "s390x",
x64: "x86_64",
x86_64: "x86_64",
x86: "x86",
ARM64: "aarch64", // To be supported by github runners
ARM32: "armv7l", // To be supported by github runners
arm32: "armv7l", // To be supported by github runners
};

/** Processor architectures supported by Miniforge */
Expand Down
7 changes: 6 additions & 1 deletion src/installer/download-miniconda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,15 @@ export async function downloadMiniconda(
inputs: types.IActionInputs
): Promise<string> {
// Check valid arch
const arch: string = constants.MINICONDA_ARCHITECTURES[inputs.architecture];
let arch: string =
constants.MINICONDA_ARCHITECTURES[inputs.architecture.toLowerCase()];
if (!arch) {
throw new Error(`Invalid arch "${inputs.architecture}"!`);
}
// Backwards compatibility: ARM64 used to map to aarch64
if (arch === "arm64" && constants.IS_LINUX) {
arch = constants.MINICONDA_ARCHITECTURES["aarch64"];
}

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

0 comments on commit 5830a04

Please sign in to comment.