go back to proper #171
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
compiler: [gcc, clang] | |
runs-on: ${{ matrix.os }} | |
env: | |
OS: ${{ matrix.os }} | |
COMPILER: ${{ matrix.compiler }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache Gradle packages | |
uses: actions/cache@v2 | |
with: | |
path: | | |
$HOME/simprop_cache | |
key: 'simprop-data' | |
- name: Install dependencies on Ubuntu | |
if: ${{ contains(env.OS, 'ubuntu') }} | |
run: sudo apt-get install -y libgsl-dev | |
- name: Install dependencies on MacOS | |
if: ${{ contains(env.OS, 'macos') }} | |
run: | | |
HOMEBREW_NO_AUTO_UPDATE=1 brew install gsl; | |
HOMEBREW_NO_AUTO_UPDATE=1 brew install gcc; | |
HOMEBREW_NO_AUTO_UPDATE=1 brew link --overwrite gcc; | |
- name: Configure paths on MacOS | |
if: ${{ contains(env.OS, 'macos') }} | |
run: | | |
GCC_BREW_PATH=$(brew --cellar gcc)/$(brew info --json gcc | jq -r '.[0].installed[0].version'); | |
- name: Configure CMake with Clang | |
if: ${{ contains(env.COMPILER, 'clang') }} | |
env: | |
CXX: 'clang++' | |
CC: 'clang' | |
CXX_COMPILER: 'clang++' | |
C_COMPILER: 'clang' | |
run: | | |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_TESTING=On -DENABLE_PYTHON=True | |
- name: Configure CMake with GCC | |
if: ${{ contains(env.COMPILER, 'gcc') }} | |
env: | |
CXX: 'g++' | |
CC: 'gcc' | |
CXX_COMPILER: 'g++' | |
C_COMPILER: 'gcc' | |
run: | | |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_TESTING=On -DENABLE_PYTHON=True | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest --output-on-failure -C ${{env.BUILD_TYPE}} | |