Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Miniconda architectures #296

Merged
merged 8 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ 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". It
is recommended to provide this value because the CPU architecture of the
runner is not detected by the workflow.'
marcoesters marked this conversation as resolved.
Show resolved Hide resolved
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
Loading