Skip to content

Commit

Permalink
ci,macos: use conda for all deps
Browse files Browse the repository at this point in the history
  • Loading branch information
vicentebolea committed Jul 29, 2024
1 parent 29745ef commit 9c05d4d
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 123 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/everything.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:

ubuntu:
needs: [format, git_checks]
if: needs.git_checks.outputs.num_code_changes > 0
if: false

runs-on: ubuntu-20.04
container:
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:

el8:
needs: [format, git_checks]
if: needs.git_checks.outputs.num_code_changes > 0
if: false

runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -276,22 +276,29 @@ jobs:

runs-on: ${{ matrix.image }}
env:
GH_YML_JOBNAME: ${{ matrix.image }}-${{ matrix.compiler }}-${{ matrix.shared }}-${{ matrix.parallel }}
# Only way to source a file in a non interactive/non login shell.
BASH_ENV: "/Users/runner/.bash_profile"
CCACHE_BASEDIR: "${GITHUB_WORKSPACE}"
CCACHE_COMPRESSLEVEL: 6
CCACHE_COMPRESS: true
CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache"
GH_YML_BASE_OS: macOS
GH_YML_MATRIX_OS: ${{ matrix.image }}
GH_YML_JOBNAME: ${{ matrix.image }}-${{ matrix.compiler }}-${{ matrix.shared }}-${{ matrix.parallel }}
GH_YML_MATRIX_ARCH : ${{ matrix.arch }}
GH_YML_MATRIX_COMPILER: ${{ matrix.compiler }}
GH_YML_MATRIX_OS: ${{ matrix.image }}
GH_YML_MATRIX_PARALLEL: ${{ matrix.parallel }}
CCACHE_BASEDIR: "${GITHUB_WORKSPACE}"
CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache"
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6

strategy:
fail-fast: false
matrix:
image: [macos-13, macos-14]
shared: [static, shared]
include:
- image: macos-13
arch: x64
- image: macos-14
arch: arm64
- parallel: serial
- image: macos-13
compiler: xcode14_2
Expand Down Expand Up @@ -341,7 +348,7 @@ jobs:

windows:
needs: [format, git_checks]
if: needs.git_checks.outputs.num_code_changes > 0
if: false

runs-on: ${{ matrix.image }}
env:
Expand Down Expand Up @@ -400,7 +407,7 @@ jobs:

docker:
needs: [format, git_checks]
if: needs.git_checks.outputs.num_code_changes > 0
if: false

runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -465,7 +472,7 @@ jobs:
# standard container job.
contract:
needs: [format, git_checks, docker]
if: needs.git_checks.outputs.num_code_changes > 0
if: false

runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -521,6 +528,7 @@ jobs:

analyze:
needs: [format, git_checks]
if: false
name: CodeQL
runs-on: ubuntu-latest
container:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pypackaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ env:
jobs:
make_sdist:
name: Make SDist
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -41,6 +42,7 @@ jobs:
build_wheels:
name: Wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: false
strategy:
fail-fast: false
matrix:
Expand Down
28 changes: 0 additions & 28 deletions scripts/ci/cmake/ci-macos-12-xcode13_4_1-shared-serial.cmake

This file was deleted.

52 changes: 0 additions & 52 deletions scripts/ci/cmake/ci-macos-12-xcode13_4_1-static-serial.cmake

This file was deleted.

8 changes: 7 additions & 1 deletion scripts/ci/cmake/ci-macos-13-xcode14_2-shared-serial.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ ADIOS2_BUILD_EXAMPLES:BOOL=ON
ADIOS2_USE_Fortran:BOOL=ON
ADIOS2_USE_MPI:BOOL=OFF
ADISO2_USE_Python:BOOL=ON
ADIOS2_USE_Blosc2:BOOL=ON
ADIOS2_USE_Bzip2:BOOL=ON
ADIOS2_USE_DataMan:BOOL=ON
ADIOS2_USE_HDF5:BOOL=ON
ADIOS2_USE_Python:BOOL=ON
ADIOS2_USE_Sodium:BOOL=ON
ADIOS2_USE_ZeroMQ:BOOL=ON
CMAKE_C_COMPILER_LAUNCHER=ccache
CMAKE_CXX_COMPILER_LAUNCHER=ccache
Expand Down
10 changes: 10 additions & 0 deletions scripts/ci/gh-actions/conda-env-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: adios2
variables:
CMAKE_PREFIX_PATH: "/Users/runner/miniconda3/envs/adios2/lib:$CMAKE_PREFIX_PATH"
dependencies:
- c-blosc2
- ccache
- hdf5
- ninja
- numpy>=1.19
- zeromq
61 changes: 30 additions & 31 deletions scripts/ci/gh-actions/macos-setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -e
set -xe

echo "Setting up default XCode version"
if [ -z "${GH_YML_MATRIX_COMPILER}" ]
Expand All @@ -15,40 +15,39 @@ then
exit 2
fi
sudo xcode-select --switch "/Applications/Xcode_${XCODE_VER}.app"
sudo ln -v -s "$(which gfortran-11)" /usr/local/bin/gfortran

echo "Installing CMake"

{
readonly version="3.24.2"
readonly checksum="efb11a78c064dd7c54a50b8da247254d252112c402c6e48cb7db3f9c84a4e5ad"
readonly pkg="cmake-${version}-macos-universal.tar.gz"
echo "${checksum} ${pkg}" > cmake.sha256sum

curl -OL "https://github.com/Kitware/CMake/releases/download/v${version}/${pkg}"
shasum -a 256 --check cmake.sha256sum

sudo tar -xvzf ${pkg} --strip-components 1 -C /Applications/
}

echo "Installing Miniconda"

echo "Installing Ninja"
brew install ninja
if [ "${RUNNER_ARCH}" = "X64" ]
then
readonly checksum="6d7c1cc138adfc4bb2ccbb8a22eb8e9eb13a366b6af0d63245b643e6c3a3c708"
readonly pkg="Miniconda3-py310_24.5.0-0-MacOSX-x86_64.sh"
elif [ "${RUNNER_ARCH}" = "ARM64" ]
then
readonly checksum="e422602aa19140c600b5889e5b41a0d7187640107ea82fcb5da857dd25330148"
readonly pkg="Miniconda3-py310_24.5.0-0-MacOSX-arm64.sh"
else
echo "Error: unknown platform: ${RUNNER_ARCH} "
exit 3
fi
echo "${checksum} ${pkg}" > miniconda.sha256sum

echo "Installing GCC"
brew install gcc
sudo ln -v -s "$(which gfortran-11)" /usr/local/bin/gfortran
curl -OL "https://repo.anaconda.com/miniconda/${pkg}"
shasum -a 256 --check miniconda.sha256sum
bash "./${pkg}" -b

echo "Installing blosc compression"
brew install c-blosc
# shellcheck source=/dev/null
source "/Users/runner/miniconda3/bin/activate"

echo "Installing python3"
brew install python numpy
# Canonical installation of Miniconda
conda init --all
conda update --all -y
conda config --add channels conda-forge
conda config --set channel_priority strict

echo "Installing ccache"
brew install ccache
conda env create -f "gha/scripts/ci/gh-actions/conda-env-macos.yml"

if [[ "$GH_YML_JOBNAME" =~ -ompi ]]
then
echo "Installing OpenMPI"
brew install openmpi mpi4py
fi
conda list
conda info --verbose
echo 'conda activate adios2' >> /Users/runner/.bash_profile
5 changes: 5 additions & 0 deletions scripts/ci/setup-run/ci-macOS.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set +u
# We do not use conda cmake, thus we have to hint cmake where is
# conda root dir.
conda activate adios2

0 comments on commit 9c05d4d

Please sign in to comment.