Merge pull request #142 from yanurag994/Build_Fixes #397
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: C/C++ CI | |
on: | |
push: | |
branches: | |
- master | |
- MPI_Development | |
- cmake_development | |
- parUpscale | |
- sharedLHF | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
mpi: | |
- mpich | |
- openmpi | |
- msmpi # Only builds for Windows | |
os: | |
- ubuntu-latest | |
- macos-latest | |
#- windows-latest | |
exclude: | |
- os: ubuntu-latest | |
mpi: msmpi #MSMPI only exists on windows | |
- os: macos-latest | |
mpi: msmpi #MSMPI only exists on windows | |
- os: windows-latest | |
mpi: openmpi #OpenMPI discontinued on windows | |
- os: windows-latest | |
mpi: mpich #MPICH redirects to MSMPI | |
##TODO: Test with windows-latest and msmpi | |
steps: | |
# Get dependencies | |
- name: Linux Apt update (${{ matrix.os }} , ${{ matrix.mpi }}) | |
if: contains(matrix.os,'ubuntu') | |
run: sudo apt-get update | |
- name: Get Linux OpenMPI dependencies (${{ matrix.os }} , ${{ matrix.mpi }}) | |
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'openmpi') | |
run: sudo apt-get install -y openmpi-bin openmpi-common libopenmpi-dev cppcheck libeigen3-dev libcgal-dev | |
- name: Get Linux MPICH dependencies (${{ matrix.os }} , ${{ matrix.mpi }}) | |
if: contains(matrix.os,'ubuntu') && contains(matrix.mpi,'mpich') | |
run: sudo apt-get install -y mpich cppcheck libeigen3-dev libcgal-dev | |
- name: Get MacOS OpenMPI dependencies (${{ matrix.os }} , ${{ matrix.mpi }}) | |
if: contains(matrix.os,'macos') && contains(matrix.mpi,'openmpi') | |
run: brew install gcc openmpi libomp eigen cgal | |
- name: Get MacOS MPICH dependencies (${{ matrix.os }} , ${{ matrix.mpi }}) | |
if: contains(matrix.os,'macos') && contains(matrix.mpi,'mpich') | |
run: brew install gcc mpich libomp eigen cgal | |
- name: Windows install CGAL | |
if: contains(matrix.os,'windows-latest') | |
run: vcpkg update && vcpkg install cgal eigen3 msmpi | |
# Checkout v2 : https://github.com/actions/checkout | |
- uses: actions/checkout@v2 | |
# Check CMake Version | |
- name: Check CMake (${{ matrix.mpi }}) | |
run: cmake --version | |
- name: Set MacOS Compilers | |
if: contains(matrix.os,'macos') | |
env: | |
CC: /usr/bin/gcc | |
CXX: /usr/bin/g++ | |
run: echo "Using CC=${CC} and CXX=${CXX}" | |
# Make the project | |
- name: cmake | |
run: cmake . && make | |
# Run cmake tests | |
- name: ctest | |
run: make test | |
- name: cppcheck | |
if: runner.os == 'Linux' | |
run: cppcheck --enable=all --force . |