Skip to content

Merge branch 'main' of github.com:KyleVaughn/UM2 into main #241

Merge branch 'main' of github.com:KyleVaughn/UM2 into main

Merge branch 'main' of github.com:KyleVaughn/UM2 into main #241

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
env:
HDF5_ROOT: /usr
OMP_NUM_THREADS: 2
ENABLE_COVERAGE: OFF
COVERALLS_PARALLEL: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
main:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
compiler: [gcc, clang]
build_type: [Debug, Release]
dev_mode: [ON]
gmsh: [ON]
int64: [OFF, ON]
float64: [OFF, ON]
name: "${{matrix.compiler}}-${{matrix.build_type}},Dev=${{matrix.dev_mode}},Gmsh=${{matrix.gmsh}},I64=${{matrix.int64}},F64=${{matrix.float64}}"
steps:
- uses: actions/checkout@v3
- name: Apt dependencies
shell: bash
run: |
sudo apt -y update
sudo apt install -y libhdf5-dev libpugixml-dev libtbb-dev
- name: gcc
shell: bash
if: matrix.compiler == 'gcc'
run: |
sudo apt install -y gcc-12 g++-12
sudo rm /usr/bin/gcov
sudo ln -s /usr/bin/gcov-12 /usr/bin/gcov
echo "CC=gcc-12" >> $GITHUB_ENV
echo "CXX=g++-12" >> $GITHUB_ENV
- name: Dev mode dependencies
shell: bash
if: matrix.dev_mode == 'ON'
run: |
sudo apt install -y clang-tidy-15 clang-format-15 cppcheck libomp-15-dev
sudo rm /usr/bin/clang-tidy
sudo ln -s /usr/bin/clang-tidy-15 /usr/bin/clang-tidy
sudo rm /usr/bin/clang-format
sudo ln -s /usr/bin/clang-format-15 /usr/bin/clang-format
- name: clang
shell: bash
if: matrix.compiler == 'clang'
run: |
sudo apt install -y clang-15 libomp-15-dev
echo "CC=clang-15" >> $GITHUB_ENV
echo "CXX=clang++-15" >> $GITHUB_ENV
- name: Gmsh
shell: bash
if: matrix.gmsh == 'ON'
run: |
sudo apt install -y libglu1-mesa
wget https://gmsh.info/bin/Linux/gmsh-4.11.1-Linux64-sdk.tgz
tar -xzvf gmsh-4.11.1-Linux64-sdk.tgz
echo "GMSH_ROOT=${PWD}/gmsh-4.11.1-Linux64-sdk" >> $GITHUB_ENV
- name: Configure with coverage
if: matrix.dev_mode == 'ON' && matrix.build_type == 'Debug' && matrix.compiler == 'gcc'
run: |
echo "ENABLE_COVERAGE=ON" >> $GITHUB_ENV
- name: Configure
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DUM2_BUILD_TUTORIAL=OFF \
-DUM2_DEV_MODE=${{ matrix.dev_mode }} \
-DUM2_USE_GMSH=${{ matrix.gmsh }} \
-DUM2_ENABLE_INT64=${{ matrix.int64 }} \
-DUM2_ENABLE_FLOAT64=${{ matrix.float64}} \
-DUM2_USE_COVERAGE=${ENABLE_COVERAGE} \
-DUM2_USE_CUDA=OFF
- name: Format check
if: matrix.dev_mode == 'ON'
run: make -C build format-check
- name: Build
run: make -j -C build
- name: Run tests
run: make -j -C build test
- name: coverage
if: matrix.dev_mode == 'ON' && matrix.build_type == 'Debug' && matrix.compiler == 'gcc'
run: |
sudo apt install -y python3 python3-pip
python3 -m pip install --upgrade pip
python3 -m pip install cpp-coveralls
python3 -m pip install coveralls
cpp-coveralls -i include -i src -e /usr --gcov /usr/bin/gcov-12 --dump cpp_cov.json
coveralls --merge=cpp_cov.json --service=github
finish:
needs: main
runs-on: ubuntu-22.04
steps:
- name: Coveralls finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true