Skip to content

Debug variants in build workflow #2095

Debug variants in build workflow

Debug variants in build workflow #2095

Workflow file for this run

name: build
on:
push:
branches: [master]
pull_request:
branches: [master]
defaults:
run:
shell: bash
jobs:
build:
name: Build
runs-on: ${{matrix.config.os}}
strategy:
matrix:
config:
- {
name: Ubuntu GCC Release,
os: ubuntu-latest,
cc: gcc,
cxx: g++,
build-type: Release,
shared: ON,
}
- {
name: Ubuntu GCC Debug,
os: ubuntu-latest,
cc: gcc,
cxx: g++,
build-type: Debug,
shared: OFF,
}
- {
name: Ubuntu Clang Release,
os: ubuntu-latest,
cc: clang,
cxx: clang++,
build-type: Release,
shared: ON,
}
- {
name: Ubuntu Clang Debug,
os: ubuntu-latest,
cc: clang,
cxx: clang++,
build-type: Debug,
shared: OFF,
}
- {
name: macOS GCC Release,
os: macos-latest,
cc: gcc,
cxx: g++,
build-type: Release,
shared: ON,
}
- {
name: macOS GCC Debug,
os: macos-latest,
cc: gcc,
cxx: g++,
build-type: Debug,
shared: OFF,
}
- {
name: macOS Clang Release,
os: macos-latest,
cc: clang,
cxx: clang++,
build-type: Release,
shared: ON,
}
- {
name: macOS Clang Debug,
os: macos-latest,
cc: clang,
cxx: clang++,
build-type: Debug,
shared: OFF,
}
- {
name: Windows GCC Release,
os: windows-latest,
cc: gcc,
cxx: g++,
build-type: Release,
shared: ON,
}
- {
name: Windows GCC Debug,
os: windows-latest,
cc: gcc,
cxx: g++,
build-type: Debug,
shared: OFF,
}
- {
name: Windows Clang Release,
os: windows-latest,
cc: clang,
cxx: clang++,
build-type: Release,
shared: ON,
}
- {
name: Windows Clang Debug,
os: windows-latest,
cc: clang,
cxx: clang++,
build-type: Debug,
shared: OFF,
}
- {
name: Windows MSVC Release,
os: windows-latest,
cc: msvc,
cxx: msvc,
build-type: Release,
shared: ON,
}
- {
name: Windows MSVC Debug,
os: windows-latest,
cc: msvc,
cxx: msvc,
build-type: Debug,
shared: OFF,
}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: "true"
# TODO: remove this step after the default Clang is updated to version 16
- name: Install LLVM and Clang
if: matrix.config.os == 'ubuntu-latest'
uses: KyleMayes/install-llvm-action@v2
with:
version: "16.0"
- name: Install GMP and MPFR on Ubuntu
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install libgmp-dev libmpfr-dev
- name: Install GMP and MPFR on macOS
if: matrix.config.os == 'macos-latest'
run: |
brew update
brew install gmp mpfr
- name: Configure CMake
working-directory: ${{github.workspace}}
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.config.build-type}} -Dfintamath_build_shared=${{matrix.config.shared}} -Dfintamath_build_tests=ON -Dfintamath_warnings_as_errors=ON
env:
CC: ${{matrix.config.cc}}
CXX: ${{matrix.config.cxx}}
- name: Build
working-directory: ${{github.workspace}}
run: cmake --build build --config ${{matrix.config.build-type}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C${{matrix.config.build-type}} --output-on-failure