From 4584a4a8b8bbddf92a062e9405ecdfc889a2a5a5 Mon Sep 17 00:00:00 2001 From: Marco Esters Date: Thu, 19 Oct 2023 06:58:09 -0700 Subject: [PATCH 1/7] Update Miniconda architectures --- src/constants.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 1e65b614..9d9c281a 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -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 */ From 1ad525808367e8f660eba2e594c41d4c93e4183f Mon Sep 17 00:00:00 2001 From: Marco Esters Date: Thu, 19 Oct 2023 06:59:08 -0700 Subject: [PATCH 2/7] Make architecture input case insensitive for Miniconda --- src/installer/download-miniconda.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/installer/download-miniconda.ts b/src/installer/download-miniconda.ts index 2414519f..9a531ed7 100644 --- a/src/installer/download-miniconda.ts +++ b/src/installer/download-miniconda.ts @@ -47,7 +47,7 @@ export async function downloadMiniconda( inputs: types.IActionInputs ): Promise { // Check valid arch - const arch: string = constants.MINICONDA_ARCHITECTURES[inputs.architecture]; + const arch: string = constants.MINICONDA_ARCHITECTURES[inputs.architecture.toLowerCase()]; if (!arch) { throw new Error(`Invalid arch "${inputs.architecture}"!`); } From aac8ae82066f3f3bab2a42a84de2780658e47e84 Mon Sep 17 00:00:00 2001 From: Marco Esters Date: Thu, 19 Oct 2023 07:05:55 -0700 Subject: [PATCH 3/7] Ensure that arm64 still maps to aarch64 on Linux --- src/installer/download-miniconda.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/installer/download-miniconda.ts b/src/installer/download-miniconda.ts index 9a531ed7..9488940b 100644 --- a/src/installer/download-miniconda.ts +++ b/src/installer/download-miniconda.ts @@ -47,10 +47,14 @@ export async function downloadMiniconda( inputs: types.IActionInputs ): Promise { // Check valid arch - const arch: string = constants.MINICONDA_ARCHITECTURES[inputs.architecture.toLowerCase()]; + 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]; From a8ea6cbf460aa74bd46cb8ca1179ed334a6b2abb Mon Sep 17 00:00:00 2001 From: Marco Esters Date: Thu, 19 Oct 2023 07:12:00 -0700 Subject: [PATCH 4/7] Update description of the architecture keyword --- action.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index a244e6f0..289b26dd 100644 --- a/action.yml +++ b/action.yml @@ -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.' required: false default: "x64" clean-patched-environment-file: From 1a0b32ee38eba7ab7c4acd5b415cca3326ad0b5c Mon Sep 17 00:00:00 2001 From: Marco Esters Date: Thu, 19 Oct 2023 07:27:24 -0700 Subject: [PATCH 5/7] Fix errors --- action.yml | 6 +++--- src/installer/download-miniconda.ts | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 289b26dd..6361ada4 100644 --- a/action.yml +++ b/action.yml @@ -235,9 +235,9 @@ inputs: default: "" architecture: description: - '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.' + '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.' required: false default: "x64" clean-patched-environment-file: diff --git a/src/installer/download-miniconda.ts b/src/installer/download-miniconda.ts index 9488940b..cc7dea27 100644 --- a/src/installer/download-miniconda.ts +++ b/src/installer/download-miniconda.ts @@ -47,13 +47,14 @@ export async function downloadMiniconda( inputs: types.IActionInputs ): Promise { // Check valid arch - let arch: string = constants.MINICONDA_ARCHITECTURES[inputs.architecture.toLowerCase()]; + 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"] + if (arch === "arm64" && constants.IS_LINUX) { + arch = constants.MINICONDA_ARCHITECTURES["aarch64"]; } let extension: string = constants.IS_UNIX ? "sh" : "exe"; From 562060092a49666be23ba0e18bd8ff3fba198c36 Mon Sep 17 00:00:00 2001 From: Marco Esters Date: Thu, 19 Oct 2023 07:45:43 -0700 Subject: [PATCH 6/7] Remove recommendation to provide value for architecture --- action.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 6361ada4..132868f9 100644 --- a/action.yml +++ b/action.yml @@ -235,9 +235,8 @@ inputs: default: "" architecture: description: - '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.' + '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: From 287aca382cd3c4722a1c4cc52d2aa73529c4861a Mon Sep 17 00:00:00 2001 From: Marco Esters Date: Thu, 19 Oct 2023 07:46:07 -0700 Subject: [PATCH 7/7] Lint files --- README.md | 3 +-- action.yml | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9c82b1af..71633e3e 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/action.yml b/action.yml index 132868f9..697be4d2 100644 --- a/action.yml +++ b/action.yml @@ -235,8 +235,8 @@ inputs: default: "" architecture: description: - 'Architecture of Miniconda that should be installed. Default is "x64". - The CPU architecture of the runner is not detected by the workflow.' + '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: