Add anisotropic coefficient of variation #229
Workflow file for this run
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: | |
pull_request: | |
branches: ["main"] | |
push: | |
branches: ["main"] | |
jobs: | |
format-check: | |
name: Format check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run clang-format style check for C/C++ programs | |
uses: jidicula/[email protected] | |
with: | |
clang-format-version: '14' | |
debug-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install OpenMP | |
run: sudo apt-get install -y libomp-dev | |
- name: Install doxygen | |
run: | | |
sudo apt update | |
sudo apt install doxygen | |
- name: Install Python build dependencies | |
run: | | |
pip install -r ${{github.workspace}}/docs/requirements.txt | |
- name: Configure | |
run: > | |
cmake -B ${{github.workspace}}/build/debug | |
-DCMAKE_BUILD_TYPE=Debug | |
-DCMAKE_C_COMPILER=clang | |
-DCMAKE_CXX_COMPILER=clang++ | |
-DTT_BUILD_TESTS=ON | |
-DBUILD_SHARED_LIBS=OFF | |
-DTT_SANITIZE=ON | |
-DTT_BUILD_DOCS=ON | |
- name: Build library | |
run: cmake --build ${{github.workspace}}/build/debug --config Debug | |
- name: Test | |
run: ctest --test-dir ${{github.workspace}}/build/debug -C Debug --output-on-failure | |
release-build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
c_compiler: [gcc, clang, cl] | |
include: | |
- c_compiler: gcc | |
cpp_compiler: g++ | |
- c_compiler: clang | |
cpp_compiler: clang++ | |
- c_compiler: cl | |
cpp_compiler: cl | |
exclude: | |
- os: windows-latest | |
c_compiler: gcc | |
- os: windows-latest | |
c_compiler: clang | |
- os: macos-latest | |
c_compiler: cl | |
- os: macos-latest | |
c_compiler: gcc | |
- os: ubuntu-latest | |
c_compiler: cl | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install OpenMP on Ubuntu | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get install -y libomp-dev | |
- name: Install OpenMP on macOS | |
if: matrix.os == 'macos-latest' | |
run: brew install libomp | |
- name: Set OpenMP_ROOT on macOS | |
if: matrix.os == 'macos-latest' | |
run: echo "OpenMP_ROOT=$(brew --prefix)/opt/libomp" >> $GITHUB_ENV | |
- name: Install ninja on windows | |
uses: seanmiddleditch/gha-setup-ninja@master | |
if: matrix.os == 'windows-latest' | |
- name: Set up MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
if: matrix.os == 'windows-latest' | |
- name: Set environment variables on Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
echo "CMAKE_GENERATOR=Ninja" >> "$env:GITHUB_ENV" && | |
echo "CMAKE_CONFIGURATION_TYPES=Release" >> "$env:GITHUB_ENV" | |
- name: Configure static library | |
run: > | |
cmake -B ${{github.workspace}}/build/static | |
-DCMAKE_BUILD_TYPE=Release | |
-DCMAKE_C_COMPILER=${{matrix.c_compiler}} | |
-DCMAKE_CXX_COMPILER=${{matrix.cpp_compiler}} | |
-DTT_BUILD_TESTS=ON | |
-DBUILD_SHARED_LIBS=OFF | |
--profiling-format=google-trace | |
--profiling-output ${{matrix.os}}_${{matrix.c_compiler}}_config_profile.json | |
- name: Build static library | |
run: cmake --build ${{github.workspace}}/build/static --config Release | |
- name: Test static library | |
run: ctest --test-dir ${{github.workspace}}/build/static -C Release --output-on-failure | |
- name: Validate JSON output of profiler | |
run: ${{github.workspace}}/build/static/test/random_dem | jq -e . | |
- name: Configure shared library | |
run: > | |
cmake -B ${{github.workspace}}/build/shared | |
-DCMAKE_BUILD_TYPE=Release | |
-DCMAKE_C_COMPILER=${{matrix.c_compiler}} | |
-DCMAKE_CXX_COMPILER=${{matrix.cpp_compiler}} | |
-DTT_BUILD_TESTS=ON | |
-DBUILD_SHARED_LIBS=ON | |
-DTT_SANITIZE=OFF | |
- name: Build shared library | |
run: cmake --build ${{github.workspace}}/build/shared --config Release | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{matrix.os}}_${{matrix.c_compiler}}_cmake_profiles | |
path: ${{matrix.os}}_${{matrix.c_compiler}}_config_profile.json |