@@ -34,14 +34,15 @@ runs:
3434 for file in sorted(glob.glob("requirement*.txt")):
3535 conda_env_key += f"\n########## {file}\n"
3636 conda_env_key += Path(file).read_text()
37+ env_name_key = hashlib.sha224(conda_env_key.encode("ascii")).hexdigest()[:8]
38+ env_name_key += "-${{ inputs.arch }}"
3739 # Nightly or Test, update every week
38- conda_env_key += datetime.date.today().strftime("%Y-week%W") + "\n"
39- conda_env_hash = hashlib.sha224(conda_env_key.encode("ascii")).hexdigest()[:8]
40+ env_name_key += "-"+datetime.date.today().strftime("%Y-week%W")
4041 shared_dir = os.environ.get("GHRUNNER_SHARED_DIR", os.getcwd())
41- env_path = os.path.join(shared_dir, "tmp", os.environ["GITHUB_RUN_ID"])
42- final_env = Path(shared_dir) / f"env_{conda_env_hash }.txt"
43- pkg_dir = Path(shared_dir) / "pkgs"
44- (Path(shared_dir) / f"env_{conda_env_hash }_content.txt").write_text(conda_env_key)
42+ env_path = os.path.join(shared_dir, "tmp", "${{ inputs.arch }}", os.environ["GITHUB_RUN_ID"])
43+ final_env = Path(shared_dir) / f"env_{env_name_key }.txt"
44+ pkg_dir = Path(shared_dir) / "pkgs-sm${{ inputs.arch }} "
45+ (Path(shared_dir) / f"env_{env_name_key }_content.txt").write_text(conda_env_key)
4546 CONDA_INSTALL_CMD += " -p " + env_path
4647 env_already_built = False
4748 # If environment is already built
5960 fp.write("CONDA_PREFIX=" + env_path + "\n")
6061 fp.write("CONDA_PKGS_DIRS=" + str(pkg_dir) + "\n")
6162 fp.write("CONDA_INSTALL_CMD=" + CONDA_INSTALL_CMD + "\n")
62- fp.write("CONDA_ENV_HASH=" + conda_env_hash + "\n")
63+ fp.write("CONDA_ENV_HASH=" + env_name_key + "\n")
6364 fp.write("PY=" + os.path.join(env_path, "bin", "python") + "\n")
6465 fp.write("PIP=" + os.path.join(env_path, "bin", "pip") + "\n")
6566 with open(os.environ['GITHUB_OUTPUT'], "r+") as fp:
7576 shell : bash -l {0}
7677 run : |
7778 set -ex
78- curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
79+ curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest -o micromamba.tar.bz2
80+ tar --extract --verbose --bzip2 --file=micromamba.tar.bz2 bin/micromamba
7981 echo "eval \"\$($(pwd)/bin/micromamba shell hook --shell bash)\"" >> ~/.profile
8082 - name : Conda/pip setup
8183 shell : bash -l {0}
0 commit comments