Skip to content

Commit

Permalink
gha: add macOS testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-zero committed Jan 24, 2023
1 parent 82f2b64 commit 5b92a60
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/testing-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
name: Testing on macOS
on:
push:
branches:
- 'develop'
pull_request:

jobs:
build-and-test:
runs-on: macos-latest

strategy:
matrix:
use_mpi: [MPI=OFF, MPI=ON]
use_openmp: [OPENMP=ON, OPENMP=OFF]
use_smm: [SMM=blas]
blas_impl: [accelerate,openblas]
mpi_suffix: [openmpi,mpich]
exclude:
- use_mpi: MPI=OFF
mpi_suffix: mpich

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true

- name: Install dependencies
run: |
env HOMEBREW_NO_AUTO_UPDATE=1 brew install \
ninja \
lcov \
openmpi
- name: Unlink OpenMPI
run: |
brew unlink openmpi
- name: Install MPICH
run: |
env HOMEBREW_NO_AUTO_UPDATE=1 brew install mpich
- name: Configure
run: |
mkdir -p build
cd build
env \
CC=gcc-11 CXX=g++-11 FC=gfortran-11 \
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Coverage \
-DUSE_${{ matrix.use_mpi }} \
-DUSE_${{ matrix.use_openmp }} \
-DUSE_${{ matrix.use_smm }} \
$([ "${{ matrix.blas_impl }}" = "openblas" ] && echo '-DCMAKE_PREFIX_PATH=/usr/local/opt/openblas') \
-DMPIEXEC_EXECUTABLE="$([ "${{ matrix.mpi_suffix }}" = "openmpi" ] && command -v /usr/local/Cellar/open-mpi/*/bin/mpiexec || command -v /usr/local/Cellar/mpich/*/bin/mpiexec)" \
-DMPIEXEC_PREFLAGS="$([ "${{ matrix.mpi_suffix }}" = "openmpi" ] && echo "-mca btl ^openib --allow-run-as-root")" \
-DTEST_MPI_RANKS=1 \
..
- name: Build
run: cmake --build build -- --verbose

- name: Test
run: |
cd build
ctest --output-on-failure
- name: Generate coverage info
run: |
cmake --build build -- cov-info
- name: Upload coverage info to codecov
if: github.repository == 'cp2k/dbcsr'
uses: codecov/codecov-action@v1
with:
file: build/coverage.info
flags: unittests,${{ matrix.use_mpi == 'MPI=ON' && 'with-mpi' || 'without-mpi' }},${{ matrix.use_openmp == 'OPENMP=ON' && 'with-openmp' || 'without-openmp' }},${{ matrix.use_smm == 'SMM=blas' && 'with-blas' || 'with-libxsmm' }}
name: dbcsr-unittests-macOS-${{ matrix.use_mpi }}-${{ matrix.use_openmp }}-${{ matrix.use_smm }}-cpu-only
fail_ci_if_error: true

# vim: set ts=2 sw=2 tw=0 :

0 comments on commit 5b92a60

Please sign in to comment.