Skip to content

Commit

Permalink
Merge pull request #134 from DARMA-tasking/133-macos-ci-doesnt-actual…
Browse files Browse the repository at this point in the history
…ly-build-and-test-the-python-bindings

#133: Fix MacOS CI pipelines
  • Loading branch information
pierrepebay authored Jan 15, 2025
2 parents 0030760 + edb2511 commit c6ab948
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 18 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/build-and-test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ jobs:
fail-fast: false
matrix:
host: [
{
base: macos-12,
compiler: { cc: clang, cxx: clang++ },
gcov: llvm-gcov,
python: ['3.8', '3.9', '3.10', '3.11', '3.12'],
vtk: '9.3.1'
},
{
base: macos-13,
compiler: { cc: clang, cxx: clang++ },
Expand Down Expand Up @@ -70,6 +63,10 @@ jobs:
run: |
brew update && brew install coreutils lcov xquartz
- name: Setup python requirements for JSON datafile validation
run: |
pip install PyYAML && pip install Brotli && pip install schema && pip install nanobind
- name: Load cache (VTK, Miniconda3)
id: base-cache
uses: actions/cache@v4
Expand Down
14 changes: 12 additions & 2 deletions ci/python_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,18 @@ VTK_DIR="${VTK_DIR:-$PARENT_DIR/vtk/build}"

VT_TV_SRC_DIR=${VT_TV_SRC_DIR:-$PARENT_DIR}

for env in $(conda env list | grep ^py | perl -lane 'print $F[-1]' | xargs ls -lrt1d | perl -lane 'print $F[-1]' | sed -r 's/^.*\/(.*)$/\1/'); do
echo "::group::Build Python Bindings (${python_version})"
$CONDA_PATH/bin/conda init bash
$CONDA_PATH/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)"
conda deactivate

for env in $(conda env list | grep -E '^py' | perl -lane 'print $F[-1]' | xargs ls -ld | perl -lane 'print $F[-1]' | sed -E 's|^.*/(.*)$|\1|'); do
echo "::group::Build Python Bindings (${env})"

# Activate conda environment
. $CONDA_PATH/etc/profile.d/conda.sh && conda activate $env
Expand Down
14 changes: 12 additions & 2 deletions ci/python_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@ pushd $VT_TV_SRC_DIR
# Create vizualization output directory (required).
mkdir -p $VT_TV_OUTPUT_DIR/python_tests

for env in $(conda env list | grep ^py | perl -lane 'print $F[-1]' | xargs ls -lrt1d | perl -lane 'print $F[-1]' | sed -r 's/^.*\/(.*)$/\1/'); do
$CONDA_PATH/bin/conda init bash
$CONDA_PATH/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)"
conda deactivate

for env in $(conda env list | grep -E '^py' | perl -lane 'print $F[-1]' | xargs ls -ld | perl -lane 'print $F[-1]' | sed -E 's|^.*/(.*)$|\1|'); do
# Clear vizualization output directory
rm -rf $VT_TV_OUTPUT_DIR/python_tests/*

echo "::group::Test Python Bindings (${python_version})"
echo "::group::Test Python Bindings (${env})"

# Activate conda environment
. $CONDA_PATH/etc/profile.d/conda.sh && conda activate $env
Expand Down
17 changes: 10 additions & 7 deletions ci/setup_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ if [ -f ~/.bashrc ]; then . ~/.bashrc; fi

echo "Conda path: $(which conda)"
echo "Conda version: $(conda --version)"
conda deactivate

echo "::endgroup::"

Expand All @@ -38,13 +39,15 @@ 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 env list

echo "Python version: $(conda run -n py${python_version} python --version)"
echo "Python:$(conda run -n py${python_version} which python)"
echo "pip: $(conda run -n py${python_version} which pip)"
conda run -n py${python_version} pip install PyYAML
conda run -n py${python_version} pip install Brotli
conda run -n py${python_version} pip install schema
conda run -n py${python_version} pip install nanobind

. $CONDA_PATH/etc/profile.d/conda.sh && conda activate py${python_version}
echo "Python version: $(python --version)"
pip install PyYAML
pip install Brotli
pip install schema
pip install nanobind
conda deactivate
echo "::endgroup::"
done

0 comments on commit c6ab948

Please sign in to comment.