diff --git a/.github/workflows/code-cov.yml b/.github/workflows/code-cov.yml new file mode 100644 index 000000000..df4f7e2d3 --- /dev/null +++ b/.github/workflows/code-cov.yml @@ -0,0 +1,162 @@ +name: Code coverage + +on: + # run tests on push events + push: + # run tests on PR events + pull_request: + types: [opened, synchronize] + +jobs: + coverage: + if: "! contains(github.event.head_commit.message, '[skip ci]')" + runs-on: ubuntu-20.04 + + strategy: + fail-fast: true + matrix: + pattern: [on,off] + pointmap: [off] + scotch: [on,off] + vtk: [off] + int: [int32_t] + + include: + # test vtk only without scotch and with delaunay insertion (more + # tests are useless) + - pattern: off + pointmap: off + scotch: off + vtk: on + int: int32_t + + # Test pointmap with scotch, with and without patterns + - pattern: off + pointmap: on + scotch: on + vtk: off + int: int32_t + + - pattern: on + pointmap: on + scotch: on + vtk: off + int: int32_t + + # Add builds for int64 + - pattern: on + pointmap: on + scotch: on + vtk: on + int: int64_t + + - pattern: off + pointmap: off + scotch: on + vtk: on + int: int64_t + + steps: + - name: Print options and set environment variables + run: | + echo "Job parameters: + Pattern: ${{ matrix.pattern }}, + Pointmap: ${{ matrix.pointmap }}, + Scotch: ${{ matrix.scotch }}, + VTK: ${{ matrix.vtk }}, + int: ${{ matrix.int }}" + + - name: Install VTK + # Download vtk only if used + if: matrix.vtk == 'on' + run: | + sudo sed -i 's/azure\.//' /etc/apt/sources.list + sudo apt-get update + sudo apt-get install -y libvtk7-dev + + - name: Install Sctoch + # Download scotch only if used + if: matrix.scotch == 'on' + run: | + git clone https://gitlab.inria.fr/scotch/scotch.git + cd scotch + git checkout v6.1.3 + cd src + cp Make.inc/Makefile.inc.x86-64_pc_linux2 Makefile.inc + make scotch -j 4 + make install scotch -j 4 + + - name: Install LibCommons + run: | + git clone https://github.com/ISCDtoolbox/Commons.git + cd Commons + mkdir build + cd build + cmake .. + make install + + - name: Install LinearElasticity + run: | + git clone https://github.com/ISCDtoolbox/LinearElasticity.git + cd LinearElasticity + mkdir build + cd build + cmake .. + make install + + # checkout the provided branch name if workflow is manually run + - uses: actions/checkout@v3 + if: inputs.branch_name + with: + ref: ${{github.event.inputs.branch}} + path: mmg + + # checkout the event branch for automatic workflows + - uses: actions/checkout@v3 + if: inputs.branch_name == '' + with: + path: mmg + + + - name: Configure Mmg with static libs (default behaviour) + run: | + cmake -Smmg -Bbuild \ + -DCMAKE_C_FLAGS="-fprofile-arcs -ftest-coverage" \ + -DCMAKE_Fortran_COMPILER=gfortran-9 \ + -DCMAKE_INSTALL_PREFIX=mmg-install \ + -DCI_CONTEXT=ON \ + -DBUILD_TESTING=ON \ + -DCMAKE_BUILD_TYPE=Debug \ + -DMMG_PATTERN=${{ matrix.pattern }} \ + -DUSE_SCOTCH=${{ matrix.scotch }} \ + -DSCOTCH_DIR=scotch \ + -DUSE_VTK=${{ matrix.vtk }} \ + -DMMG5_INT=${{ matrix.int }} \ + -DTEST_LIBMMG=ON \ + -DTEST_LIBMMGS=ON \ + -DTEST_LIBMMG2D=ON \ + -DTEST_LIBMMG3D=ON \ + -DONLY_VERY_SHORT_TESTS=ON + shell: bash + + - name: Build Mmg + run: | + cmake --build build --config Debug -j 4 + + - name: Install Mmg + run: | + cmake --build build --target install --config Debug -j 4 + + - name: Test Mmg + run: | + cd build + ctest --timeout 7200 -VV -C Debug -j 4 + + + - name: Upload coverage to Codecov + #if: inputs.CODE_COVERAGE + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/main-job.yml b/.github/workflows/main-job.yml index 6d7b74485..ef0c7b9e0 100644 --- a/.github/workflows/main-job.yml +++ b/.github/workflows/main-job.yml @@ -261,48 +261,48 @@ jobs: cmake .. make install - - name: Test compilation with shared libs linkage - run: | - cmake -Smmg -Bbuild_shared \ - ${{ env.CMAKE_C_FLG }} \ - ${{ env.FORT_FLG }} \ - -DCI_CONTEXT=ON \ - -DBUILD_TESTING=ON \ - -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ - -DMMG_PATTERN=${{ matrix.pattern }} \ - -DUSE_SCOTCH=${{ matrix.scotch }} \ - -DSCOTCH_DIR=scotch-install \ - -DUSE_VTK=${{ matrix.vtk }} \ - -DMMG5_INT=${{ matrix.int }} \ - -DBUILD_SHARED_LIBS=ON \ - -DTEST_LIBMMG=ON \ - -DTEST_LIBMMGS=ON \ - -DTEST_LIBMMG2D=ON \ - -DTEST_LIBMMG3D=ON \ - ${{ inputs.add_cmake_cfg_args }} - 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.CMAKE_C_FLG }} \ - ${{ env.FORT_FLG }} \ - -DCI_CONTEXT=ON \ - -DBUILD_TESTING=ON \ - -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ - -DMMG_PATTERN=${{ matrix.pattern }} \ - -DUSE_SCOTCH=${{ matrix.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 ${{ env.BUILD_TYPE }} -j ${{ env.NJOBS }} - shell: bash + #name: Test compilation with shared libs linkage + #run: | + # cmake -Smmg -Bbuild_shared \ + # ${{ env.CMAKE_C_FLG }} \ + # ${{ env.FORT_FLG }} \ + # -DCI_CONTEXT=ON \ + # -DBUILD_TESTING=ON \ + # -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ + # -DMMG_PATTERN=${{ matrix.pattern }} \ + # -DUSE_SCOTCH=${{ matrix.scotch }} \ + # -DSCOTCH_DIR=scotch-install \ + # -DUSE_VTK=${{ matrix.vtk }} \ + # -DMMG5_INT=${{ matrix.int }} \ + # -DBUILD_SHARED_LIBS=ON \ + # -DTEST_LIBMMG=ON \ + # -DTEST_LIBMMGS=ON \ + # -DTEST_LIBMMG2D=ON \ + # -DTEST_LIBMMG3D=ON \ + # ${{ inputs.add_cmake_cfg_args }} + # 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.CMAKE_C_FLG }} \ + # ${{ env.FORT_FLG }} \ + # -DCI_CONTEXT=ON \ + # -DBUILD_TESTING=ON \ + # -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ + # -DMMG_PATTERN=${{ matrix.pattern }} \ + # -DUSE_SCOTCH=${{ matrix.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 ${{ env.BUILD_TYPE }} -j ${{ env.NJOBS }} + #shell: bash - name: Configure Mmg with static libs (default behaviour) run: | @@ -344,14 +344,14 @@ jobs: if: matrix.vtk == 'off' && matrix.int == 'int32_t' run: | cd build - ctest --timeout 7200 -VV -C ${{ env.BUILD_TYPE }} -j ${{ env.NJOBS }} + ctest --timeout 7200 -N -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 ${{ env.BUILD_TYPE }} -j ${{ env.NJOBS }} + ctest --timeout 7200 -N -VV -C ${{ env.BUILD_TYPE }} -j ${{ env.NJOBS }} - name: Test non native I/Os of Mmg if: matrix.vtk == 'on' @@ -368,7 +368,7 @@ jobs: build/TEST_OUTPUTS - name: Upload coverage to Codecov - if: inputs.code_coverage == true + #if: matrix.os == 'ubuntu-20.04' uses: codecov/codecov-action@v4 with: fail_ci_if_error: true