Skip to content

Commit

Permalink
Merge branch 'develop' into feature/factorize-chkbdrytria
Browse files Browse the repository at this point in the history
  • Loading branch information
Corentin Prigent committed Apr 16, 2024
2 parents a82f2c3 + 058f9a3 commit b1fbb9a
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 97 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/fast-check.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/long-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ jobs:
cmake_build_type: RelWithAssert
add_cmake_cfg_args: -D LONG_TESTS=ON
branch_name: ${{github.event.inputs.branch}}
code_coverage: true
secrets: inherit
104 changes: 73 additions & 31 deletions .github/workflows/main-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ on:
required: false
type: string

code_coverage:
description: 'Code coverage'
required: false
default: true
type: boolean

# job
jobs:
ci:
Expand Down Expand Up @@ -141,6 +147,24 @@ jobs:
int: int64_t

steps:
- name: Set cmake_build_type and export coverage flags
run: |
if ${{ matrix.os == 'ubuntu-20.04' && inputs.code_coverage == true }}; then
# if code coverage is enabled, linux build is runned in Debug mode
if [[ ${{ inputs.cmake_build_type }} != Debug ]]; then
echo "WARNING: build type is forced to debug mode on ubuntu to allow coverage."
fi
echo "BUILD_TYPE=Debug" >> "$GITHUB_ENV"
echo "C_FLG_PROF=-fprofile-arcs -ftest-coverage" >> "$GITHUB_ENV"
else
echo "BUILD_TYPE=${{ inputs.cmake_build_type }}" >> "$GITHUB_ENV"
fi
shell: bash

- name: Print options and set environment variables
run: |
echo "${{ github.event.inputs.name }}:
Expand All @@ -149,7 +173,7 @@ jobs:
Scotch: ${{ matrix.scotch }},
VTK: ${{ matrix.vtk }},
int: ${{ matrix.int }},
Build: ${{ inputs.cmake_build_type }}"
Build: ${{ env.BUILD_TYPE }}"
# gfortran compiler and scotch makefile depends on the os
if [ "$RUNNER_OS" == "macOS" ]; then
Expand All @@ -170,9 +194,14 @@ jobs:
- name: Set environment variables for output comparison
if: "! contains(github.event.head_commit.message, '[skip output comparison]')"
run: |
echo "C_FLG=\"-DCMAKE_C_FLAGS=-DMMG_COMPARABLE_OUTPUT\"" >> "$GITHUB_ENV"
echo "C_FLG=-DMMG_COMPARABLE_OUTPUT" >> "$GITHUB_ENV"
echo "MMG_ERROR_RULE=\"COMMAND_ERROR_IS_FATAL ANY\"" >> "$GITHUB_ENV"
- name: Assign CMAKE_C_FLAGS if needed
if: ${{ env.C_FLG || env.C_FLG_PROF }}
run: |
echo "CMAKE_C_FLG=-DCMAKE_C_FLAGS=\"${{ env.C_FLG }} ${{ env.C_FLG_PROF }}\"" >> "$GITHUB_ENV"
- name: Install VTK
# Download vtk only if used
if: matrix.vtk == 'on'
Expand All @@ -195,7 +224,7 @@ jobs:
cd src
cp ${{ env.SCOTCH_MAKE }} Makefile.inc
make scotch -j ${{ env.NJOBS }}
make install scotch -j ${{ env.NJOBS }}
make prefix=../../scotch-install install -j ${{ env.NJOBS }}
- name: Install LibCommons
# LinearElasticity don't build with MSVC
Expand All @@ -220,29 +249,30 @@ jobs:
make install
# checkout the provided branch name if workflow is manually run
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: inputs.branch_name
with:
ref: ${{github.event.inputs.branch}}
path: mmg

# checkout the event branch for automatic workflows
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: inputs.branch_name == ''
with:
path: mmg

- name: Test compilation with shared libs linkage
run: |
cmake -Smmg -Bbuild_shared \
${{ env.C_FLG }} \
${{ env.CMAKE_C_FLG }} \
${{ env.FORT_FLG }} \
-DCI_CONTEXT=ON \
-DBUILD_TESTING=ON \
-DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} \
-DUSE_POINTMAP=${{ matrix.pointmap }} \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DMMG_PATTERN=${{ matrix.pattern }} \
-DUSE_SCOTCH=${{ matrix.scotch }} \
-DSCOTCH_DIR=scotch \
-DSCOTCH_DIR=scotch-install \
-DUSE_VTK=${{ matrix.vtk }} \
-DMMG5_INT=${{ matrix.int }} \
-DBUILD_SHARED_LIBS=ON \
Expand All @@ -251,42 +281,44 @@ jobs:
-DTEST_LIBMMG2D=ON \
-DTEST_LIBMMG3D=ON \
${{ inputs.add_cmake_cfg_args }}
cmake --build build_shared --config ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }}
cmake --build build_shared --config ${{ env.BUILD_TYPE }} -j ${{ env.NJOBS }}
shell: bash

- name: Test compilation without library linkage
run: |
cmake -Smmg -Bbuild_nolibs \
${{ env.C_FLG }} \
${{ env.CMAKE_C_FLG }} \
${{ env.FORT_FLG }} \
-DCI_CONTEXT=ON \
-DBUILD_TESTING=ON \
-DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} \
-DUSE_POINTMAP=${{ matrix.pointmap }} \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DMMG_PATTERN=${{ matrix.pattern }} \
-DUSE_SCOTCH=${{ matrix.scotch }} \
-DSCOTCH_DIR=scotch \
-DSCOTCH_DIR=scotch-install \
-DUSE_VTK=${{ matrix.vtk }} \
-DMMG5_INT=${{ matrix.int }} \
-DLIBMMG_STATIC=OFF \
-DLIBMMGS_STATIC=OFF \
-DLIBMMG2D_STATIC=OFF \
-DLIBMMG3D_STATIC=OFF \
${{ inputs.add_cmake_cfg_args }}
cmake --build build_nolibs --config ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }}
cmake --build build_nolibs --config ${{ env.BUILD_TYPE }} -j ${{ env.NJOBS }}
shell: bash

- name: Configure Mmg with static libs (default behaviour)
run: |
cmake -Smmg -Bbuild \
${{ env.C_FLG }} \
${{ env.CMAKE_C_FLG }} \
${{ env.FORT_FLG }} \
-DCMAKE_INSTALL_PREFIX=mmg-install \
-DCI_CONTEXT=ON \
-DBUILD_TESTING=ON \
-DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} \
-DUSE_POINTMAP=${{ matrix.pointmap }} \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DMMG_PATTERN=${{ matrix.pattern }} \
-DUSE_SCOTCH=${{ matrix.scotch }} \
-DSCOTCH_DIR=scotch \
-DSCOTCH_DIR=scotch-install \
-DUSE_VTK=${{ matrix.vtk }} \
-DMMG5_INT=${{ matrix.int }} \
-DTEST_LIBMMG=ON \
Expand All @@ -298,15 +330,15 @@ jobs:

- name: Build Mmg
run: |
cmake --build build --config ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }}
cmake --build build --config ${{ env.BUILD_TYPE }} -j ${{ env.NJOBS }}
- name: Install Mmg
run: |
cmake --build build --target install --config ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }}
cmake --build build --target install --config ${{ env.BUILD_TYPE }} -j ${{ env.NJOBS }}
- name: Archive production artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Mmg-bin
name: Mmg-bin-${{ matrix.os }}-${{ matrix.pattern }}-${{ matrix.pointmap }}-${{ matrix.scotch }}-${{ matrix.vtk }}-${{ matrix.int }}
path: |
build/bin
Expand All @@ -315,25 +347,35 @@ jobs:
if: matrix.vtk == 'off' && matrix.int == 'int32_t'
run: |
cd build
ctest --timeout 7200 -VV -C ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }}
ctest --timeout 7200 -VV -C ${{ env.BUILD_TYPE }} -j ${{ env.NJOBS }}
- name: Test Mmg with in64_t integers
# Run long tests only on ubuntu with pattern off, scotch on, vtk on and int64_t integers
if: matrix.os == 'ubuntu-20.04' && matrix.pattern == 'off' && matrix.scotch == 'on' && matrix.vtk == 'on' && matrix.int == 'int64_t'
run: |
cd build
ctest --timeout 7200 -VV -C ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }}
ctest --timeout 7200 -VV -C ${{ env.BUILD_TYPE }} -j ${{ env.NJOBS }}
- name: Test non native I/Os of Mmg
if: matrix.vtk == 'on'
run: |
cd build
ctest -R "msh|vtk" -VV -C ${{ inputs.cmake_build_type }} -j ${{ env.NJOBS }}
# - name: Archive production artifacts for tests
# if: success() || failure()
# uses: actions/upload-artifact@v2
# with:
# name: Mmg-tests
# path: |
# build/TEST_OUTPUTS
ctest -R "msh|vtk" -VV -C ${{ env.BUILD_TYPE }} -j ${{ env.NJOBS }}
- name: Archive production artifacts for tests
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: Mmg-tests-${{ matrix.os }}-${{ matrix.pattern }}-${{ matrix.pointmap }}-${{ matrix.scotch }}-${{ matrix.vtk }}-${{ matrix.int }}
path: |
build/TEST_OUTPUTS
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-20.04' && inputs.code_coverage == true
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
root_dir: .
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fixes:
- "mmg/mmg::"

Loading

0 comments on commit b1fbb9a

Please sign in to comment.