From e406a23a17ca31706c648b89773befeff12542f2 Mon Sep 17 00:00:00 2001 From: Vicente Adolfo Bolea Sanchez Date: Fri, 26 Jul 2024 18:07:22 -0400 Subject: [PATCH] ci,macos: use conda for all deps --- .github/workflows/everything.yml | 27 ++++++++------ .github/workflows/pypackaging.yml | 2 + scripts/ci/gh-actions/macos-setup.sh | 55 ++++++++++++---------------- scripts/ci/setup-run/ci-macOS.sh | 6 +++ 4 files changed, 48 insertions(+), 42 deletions(-) create mode 100644 scripts/ci/setup-run/ci-macOS.sh diff --git a/.github/workflows/everything.yml b/.github/workflows/everything.yml index 8b413719e1..f08d397396 100644 --- a/.github/workflows/everything.yml +++ b/.github/workflows/everything.yml @@ -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: @@ -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: @@ -281,6 +281,7 @@ jobs: GH_YML_MATRIX_OS: ${{ matrix.image }} GH_YML_MATRIX_COMPILER: ${{ matrix.compiler }} GH_YML_MATRIX_PARALLEL: ${{ matrix.parallel }} + GH_YML_MATRIX_ARCH : ${{ matrix.arch}} CCACHE_BASEDIR: "${GITHUB_WORKSPACE}" CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache" CCACHE_COMPRESS: true @@ -292,6 +293,10 @@ jobs: 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 @@ -300,6 +305,9 @@ jobs: exclude: - image: macos-13 shared: static + defaults: + run: + shell: bash --rcfile /Users/runner/.bash_profile -e {0} steps: - uses: actions/checkout@v4 @@ -320,7 +328,7 @@ jobs: restore-keys: | ccache-${{ matrix.image }}-${{ matrix.compiler }}-${{ matrix.parallel }} - name: Configure cache - run: ccache -z + run: conda activate adios2; ccache -z - name: Update run: gha/scripts/ci/gh-actions/run.sh update - name: Configure @@ -328,7 +336,7 @@ jobs: - name: Build run: gha/scripts/ci/gh-actions/run.sh build - name: Print ccache statistics - run: ccache -s + run: conda activate adios2; ccache -s - name: Save cache uses: actions/cache/save@v3 if: ${{ github.ref_name == 'master' && steps.restore-cache.outputs.cache-hit != 'true' }} @@ -341,7 +349,7 @@ jobs: windows: needs: [format, git_checks] - if: needs.git_checks.outputs.num_code_changes > 0 + if: false runs-on: ${{ matrix.image }} env: @@ -370,10 +378,6 @@ jobs: compiler: vs2022 parallel: serial - defaults: - run: - shell: bash - steps: - uses: actions/checkout@v4 with: @@ -400,7 +404,7 @@ jobs: docker: needs: [format, git_checks] - if: needs.git_checks.outputs.num_code_changes > 0 + if: false runs-on: ubuntu-latest strategy: @@ -465,7 +469,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: @@ -521,6 +525,7 @@ jobs: analyze: needs: [format, git_checks] + if: false name: CodeQL runs-on: ubuntu-latest container: diff --git a/.github/workflows/pypackaging.yml b/.github/workflows/pypackaging.yml index 022807108e..f7d7f75c00 100644 --- a/.github/workflows/pypackaging.yml +++ b/.github/workflows/pypackaging.yml @@ -22,6 +22,7 @@ env: jobs: make_sdist: name: Make SDist + if: false runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -41,6 +42,7 @@ jobs: build_wheels: name: Wheel on ${{ matrix.os }} runs-on: ${{ matrix.os }} + if: false strategy: fail-fast: false matrix: diff --git a/scripts/ci/gh-actions/macos-setup.sh b/scripts/ci/gh-actions/macos-setup.sh index 0eb6850f20..3f7fe9a043 100755 --- a/scripts/ci/gh-actions/macos-setup.sh +++ b/scripts/ci/gh-actions/macos-setup.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -xe echo "Setting up default XCode version" if [ -z "${GH_YML_MATRIX_COMPILER}" ] @@ -16,39 +16,32 @@ then fi sudo xcode-select --switch "/Applications/Xcode_${XCODE_VER}.app" -echo "Installing CMake" +echo "Installing Miniconda" -{ - 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/ -} +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 +curl -OL "https://repo.anaconda.com/miniconda/${pkg}" +shasum -a 256 --check miniconda.sha256sum +bash "./${pkg}" -b -echo "Installing Ninja" -brew install ninja +# shellcheck source=/dev/null +source "/Users/runner/miniconda3/bin/activate" +conda init --all +conda update --all -y -echo "Installing GCC" -brew install gcc +conda create -n adios2 -c conda-forge -y ninja c-blosc2 numpy ccache openmpi mpi4py sudo ln -v -s "$(which gfortran-11)" /usr/local/bin/gfortran -echo "Installing blosc compression" -brew install c-blosc - -echo "Installing python3" -brew install python numpy - -echo "Installing ccache" -brew install ccache - -if [[ "$GH_YML_JOBNAME" =~ -ompi ]] -then - echo "Installing OpenMPI" - brew install openmpi mpi4py -fi +conda info --verbose diff --git a/scripts/ci/setup-run/ci-macOS.sh b/scripts/ci/setup-run/ci-macOS.sh new file mode 100644 index 0000000000..6c95940ae1 --- /dev/null +++ b/scripts/ci/setup-run/ci-macOS.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set +u +# We do not use conda cmake, thus we have to hint cmake where is +# conda root dir. +export CMAKE_PREFIX_PATH="/Users/runner/miniconda3/Library:$CMAKE_PREFIX_PATH" +conda activate adios2