generated from DARMA-tasking/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#97: CI refactoring to remove duplicate commands
- Loading branch information
1 parent
9abca44
commit 5f42e1c
Showing
8 changed files
with
129 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
# This script installs Conda and setup conda environments on the host machine for the given python versions | ||
# Example: setup_conda.sh 3.8,3.9,3.10,3.11,3.12 | ||
|
||
CONDA_PREFIX=${CONDA_PREFIX:-"/opt/miniconda3"} | ||
PYTHON_VERSIONS=${1:-"3.8,3.9,3.10,3.11,3.12"} | ||
|
||
echo "::group::Install conda" | ||
mkdir -p ~/miniconda3 | ||
if [[ $(uname -a) == *"Darwin"* ]]; then | ||
if [[ $(arch) == 'arm64' ]]; then | ||
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda.sh | ||
else | ||
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o ~/miniconda.sh | ||
fi | ||
else | ||
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o ~/miniconda.sh | ||
fi | ||
bash ~/miniconda.sh -b -u -p $CONDA_PREFIX | ||
rm -rf ~/miniconda.sh | ||
|
||
$CONDA_PREFIX/bin/conda init bash | ||
$CONDA_PREFIX/bin/conda init zsh | ||
if [ -f ~/.zshrc ]; then | ||
. ~/.zshrc | ||
fi | ||
if [ -f ~/.profile ]; then | ||
. ~/.profile | ||
fi | ||
if [ -f ~/.bashrc ]; then | ||
. ~/.bashrc | ||
fi | ||
|
||
echo "Conda path: $(which conda)" | ||
echo "Conda version: $(conda --version)" | ||
|
||
echo "::endgroup::" | ||
|
||
versions=(`echo $PYTHON_VERSIONS | sed 's/,/\n/g'`) | ||
for python_version in "${versions[@]}" | ||
do | ||
echo "::group::Create conda environment (py${python_version})" | ||
conda create -y -n py${python_version} python=${python_version} | ||
|
||
. $CONDA_PREFIX/etc/profile.d/conda.sh && conda activate py${python_version} | ||
echo "Python version: $(python --version)" | ||
pip install nanobind | ||
conda deactivate | ||
echo "::endgroup::" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.