Skip to content

Commit

Permalink
Upgrade macOS CI to Apple Silicon
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsvu committed Jun 5, 2024
1 parent b2421a8 commit 428d3ea
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions .github/workflows/Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -858,17 +858,15 @@ ${{ matrix.build_type }}-pch-${{ matrix.use_pch || 'ON' }}"
# Build all test executables and run unit tests on macOS
unit_tests_macos:
name: Unit tests on macOS
runs-on: macos-13
runs-on: macos-14
env:
# We install some low-level dependencies with Homebrew. They get picked up
# by `spack external find`.
SPECTRE_BREW_DEPS: >- # Line breaks are spaces, no trailing newline
autoconf automake catch2 ccache cmake pkg-config boost
autoconf automake boost catch2 ccache cmake gsl hdf5 yaml-cpp
# We install these packages with Spack and cache them. The full specs are
# listed in support/DevEnvironments/spack.yaml. This list is only needed
# to create the cache.
SPECTRE_SPACK_DEPS: >-
blaze charmpp gsl hdf5 libxsmm openblas yaml-cpp
# listed below. This list is only needed to create the cache.
SPECTRE_SPACK_DEPS: blaze charmpp libxsmm
CCACHE_DIR: $HOME/ccache
CCACHE_TEMPDIR: $HOME/ccache-tmp
CCACHE_MAXSIZE: "2G"
Expand All @@ -877,6 +875,9 @@ ${{ matrix.build_type }}-pch-${{ matrix.use_pch || 'ON' }}"
CCACHE_COMPILERCHECK: content
SPACK_SKIP_MODULES: true
SPACK_COLOR: always
# The number of cores to run on. This is given at:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
NUM_CORES: 3
steps:
- name: Record start time
id: start
Expand All @@ -886,7 +887,7 @@ ${{ matrix.build_type }}-pch-${{ matrix.use_pch || 'ON' }}"
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
- name: Install Homebrew dependencies
run: |
brew install $SPECTRE_BREW_DEPS
Expand All @@ -901,11 +902,14 @@ ${{ matrix.build_type }}-pch-${{ matrix.use_pch || 'ON' }}"
restore-keys: |
dependencies-macos-
- name: Install Spack
# Pin a specific version of Spack to avoid breaking CI builds when
# Spack changes.
run: |
cd $HOME
git clone -c feature.manyFiles=true --depth=1 \
--branch releases/v0.18 --single-branch \
git clone -c feature.manyFiles=true \
https://github.com/spack/spack.git
cd spack
git checkout 4fba351b9217626285bf26a07ab3bdfa8218722f
- name: Configure Spack
# - To avoid re-building packages that are already installed by Homebrew
# we let Spack find them.
Expand All @@ -914,7 +918,7 @@ ${{ matrix.build_type }}-pch-${{ matrix.use_pch || 'ON' }}"
source $HOME/spack/share/spack/setup-env.sh
spack debug report
spack compiler find && spack compiler list
spack external find && spack external find perl python
spack external find
spack config get packages
spack mirror add dependencies file://$HOME/dependencies/spack
# Install the remaining dependencies from source with Spack. We install
Expand All @@ -923,9 +927,11 @@ ${{ matrix.build_type }}-pch-${{ matrix.use_pch || 'ON' }}"
- name: Install Spack dependencies
run: |
source $HOME/spack/share/spack/setup-env.sh
spack env create spectre support/DevEnvironments/spack.yaml
spack env create spectre
spack env activate spectre
spack remove catch2 doxygen jemalloc boost
spack add blaze@3.8 ~blas ~lapack smp=none
spack add charmpp@7.0.0 +shared backend=multicore build-target=charm++
spack add libxsmm@1.16.1:
spack concretize --reuse
spack install --no-check-signature
spack find -v
Expand Down Expand Up @@ -992,7 +998,6 @@ ${{ matrix.build_type }}-pch-${{ matrix.use_pch || 'ON' }}"
-D CMAKE_CXX_COMPILER=clang++ \
-D CMAKE_Fortran_COMPILER=gfortran-11 \
-D CMAKE_CXX_FLAGS="-Werror" \
-D OVERRIDE_ARCH=x86-64 \
-D BUILD_SHARED_LIBS=ON \
-D BUILD_PYTHON_BINDINGS=ON \
-D MEMORY_ALLOCATOR=SYSTEM \
Expand All @@ -1011,10 +1016,8 @@ ${{ matrix.build_type }}-pch-${{ matrix.use_pch || 'ON' }}"
$GITHUB_WORKSPACE
- name: Build unit tests
working-directory: build
# Build on 4 threads because GitHub's macOS VMs have 4 cores:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
run: |
make -j4 unit-tests
make -j${NUM_CORES} unit-tests
- name: Build executables
working-directory: build
run: |
Expand Down Expand Up @@ -1042,7 +1045,7 @@ ${{ matrix.build_type }}-pch-${{ matrix.use_pch || 'ON' }}"
- name: Run unit tests
working-directory: build
run: |
ctest -j4 --repeat after-timeout:3 --output-on-failure
ctest -j${NUM_CORES} --repeat after-timeout:3 --output-on-failure
- name: Install
working-directory: build
run: |
Expand Down

0 comments on commit 428d3ea

Please sign in to comment.