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 all 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
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
Loading