From 4c03002ef60f2a045ee8236e94c47cf383bc2033 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 19 Apr 2024 11:17:28 +0200 Subject: [PATCH 1/8] Fix workflows 'errors' shown in vscode. --- .github/workflows/main-job.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main-job.yml b/.github/workflows/main-job.yml index 1d6588c70..94a561874 100644 --- a/.github/workflows/main-job.yml +++ b/.github/workflows/main-job.yml @@ -26,7 +26,7 @@ on: # job jobs: ci: - if: "! contains(github.event.head_commit.message, '[skip ci]')" + if: ! contains(github.event.head_commit.message, '[skip ci]') runs-on: ${{ matrix.os }} # Launch a matrix of jobs @@ -192,7 +192,7 @@ jobs: NJOBS: "2" - name: Set environment variables for output comparison - if: "! contains(github.event.head_commit.message, '[skip output comparison]')" + if: ! contains(github.event.head_commit.message, '[skip output comparison]') run: | echo "C_FLG=-DMMG_COMPARABLE_OUTPUT" >> "$GITHUB_ENV" echo "MMG_ERROR_RULE=\"COMMAND_ERROR_IS_FATAL ANY\"" >> "$GITHUB_ENV" From c8c24566db71d9bb864d974d4dcb9fcd0c6835dc Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 19 Apr 2024 12:05:14 +0200 Subject: [PATCH 2/8] TO REVERT: speed up testing while coverage is being modified --- .github/workflows/main-job.yml | 94 ++++++++++++++++------------------ 1 file changed, 45 insertions(+), 49 deletions(-) diff --git a/.github/workflows/main-job.yml b/.github/workflows/main-job.yml index 94a561874..8c813df9c 100644 --- a/.github/workflows/main-job.yml +++ b/.github/workflows/main-job.yml @@ -261,50 +261,50 @@ jobs: with: path: mmg - - 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 \ - -DUSE_POINTMAP=${{ matrix.pointmap }} \ - -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 \ - -DUSE_POINTMAP=${{ matrix.pointmap }} \ - -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 \ + # -DUSE_POINTMAP=${{ matrix.pointmap }} \ + # -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 \ + # -DUSE_POINTMAP=${{ matrix.pointmap }} \ + # -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: | @@ -321,11 +321,7 @@ jobs: -DSCOTCH_DIR=scotch-install \ -DUSE_VTK=${{ matrix.vtk }} \ -DMMG5_INT=${{ matrix.int }} \ - -DTEST_LIBMMG=ON \ - -DTEST_LIBMMGS=ON \ - -DTEST_LIBMMG2D=ON \ - -DTEST_LIBMMG3D=ON \ - ${{ inputs.add_cmake_cfg_args }} + -DONLY_VERY_SHORT_TESTS=ON shell: bash - name: Build Mmg From f381129b752c9367c8347ed23aaaa48b43bd0cb7 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 19 Apr 2024 15:15:52 +0200 Subject: [PATCH 3/8] Test coverage job. --- .github/workflows/main-job.yml | 96 +++++++++++++++++++++++++++------- 1 file changed, 77 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main-job.yml b/.github/workflows/main-job.yml index 8c813df9c..db224c36b 100644 --- a/.github/workflows/main-job.yml +++ b/.github/workflows/main-job.yml @@ -331,13 +331,6 @@ jobs: run: | cmake --build build --target install --config ${{ env.BUILD_TYPE }} -j ${{ env.NJOBS }} - - name: Archive production artifacts - uses: actions/upload-artifact@v4 - with: - name: Mmg-bin-${{ matrix.os }}-${{ matrix.pattern }}-${{ matrix.pointmap }}-${{ matrix.scotch }}-${{ matrix.vtk }}-${{ matrix.int }} - path: | - build/bin - - name: Test Mmg with in32_t integers # Run long tests only with vtk off and int32_t integers if: matrix.vtk == 'off' && matrix.int == 'int32_t' @@ -358,20 +351,85 @@ jobs: cd build ctest -R "msh|vtk" -VV -C ${{ env.BUILD_TYPE }} -j ${{ env.NJOBS }} - - name: Archive production artifacts for tests + - name: Archive production artifacts if: success() || failure() uses: actions/upload-artifact@v4 with: - name: Mmg-tests-${{ matrix.os }}-${{ matrix.pattern }}-${{ matrix.pointmap }}-${{ matrix.scotch }}-${{ matrix.vtk }}-${{ matrix.int }} + name: build-${{ matrix.os }}-${{ matrix.pattern }}-${{ matrix.pointmap }}-${{ matrix.scotch }}-${{ matrix.vtk }}-${{ matrix.int }} path: | - build/TEST_OUTPUTS + build - - 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 }} + upload_coverage: + runs-on: ${{ matrix.os }} + needs: ci + + strategy: + matrix: + os: [ubuntu-20.04] + pattern: [on,off] + pointmap: [off] + scotch: [on,off] + vtk: [off] + int: [int32_t] + + include: + # test vtk only without scotch + - os: ubuntu-20.04 + pattern: off + pointmap: off + scotch: off + vtk: on + int: int32_t + + # Test pointmap with scotch excep + - os: ubuntu-20.04 + pattern: off + pointmap: on + scotch: on + vtk: off + int: int32_t + + # Test int64_t build on all archi + - os: ubuntu-20.04 + pattern: on + pointmap: on + scotch: on + vtk: on + int: int64_t + + - os: ubuntu-20.04 + pattern: off + pointmap: off + scotch: on + vtk: on + int: int64_t + + - os: ubuntu-20.04 + pattern: off + pointmap: off + scotch: off + vtk: off + int: int64_t + + steps: + - name: Checkout repository + # Codecov need the source code to pair with coverage + uses: actions/checkout@v4 + with: + path: mmg + + - name: Download coverage artifact + uses: actions/download-artifact@v4 + with: + name: build-${{ matrix.os }}-${{ matrix.pattern }}-${{ matrix.pointmap }}-${{ matrix.scotch }}-${{ matrix.vtk }}-${{ matrix.int }} + path: build + + - 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 }} From feb6a14edb543157b635aa024c6921d9bdbd7fe3 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 19 Apr 2024 15:18:16 +0200 Subject: [PATCH 4/8] Revert "Fix workflows 'errors' shown in vscode." This reverts commit 4c03002ef60f2a045ee8236e94c47cf383bc2033. --- .github/workflows/main-job.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main-job.yml b/.github/workflows/main-job.yml index db224c36b..d390b2612 100644 --- a/.github/workflows/main-job.yml +++ b/.github/workflows/main-job.yml @@ -26,7 +26,7 @@ on: # job jobs: ci: - if: ! contains(github.event.head_commit.message, '[skip ci]') + if: "! contains(github.event.head_commit.message, '[skip ci]')" runs-on: ${{ matrix.os }} # Launch a matrix of jobs @@ -192,7 +192,7 @@ jobs: NJOBS: "2" - name: Set environment variables for output comparison - if: ! contains(github.event.head_commit.message, '[skip output comparison]') + if: "! contains(github.event.head_commit.message, '[skip output comparison]')" run: | echo "C_FLG=-DMMG_COMPARABLE_OUTPUT" >> "$GITHUB_ENV" echo "MMG_ERROR_RULE=\"COMMAND_ERROR_IS_FATAL ANY\"" >> "$GITHUB_ENV" From 29fbd552728dfea5ab4b92eed85bef839318d05c Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 19 Apr 2024 15:44:54 +0200 Subject: [PATCH 5/8] Test to merge artifacts. --- .github/workflows/main-job.yml | 53 ++-------------------------------- 1 file changed, 2 insertions(+), 51 deletions(-) diff --git a/.github/workflows/main-job.yml b/.github/workflows/main-job.yml index d390b2612..3fae004f1 100644 --- a/.github/workflows/main-job.yml +++ b/.github/workflows/main-job.yml @@ -360,57 +360,9 @@ jobs: build upload_coverage: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest needs: ci - strategy: - matrix: - os: [ubuntu-20.04] - pattern: [on,off] - pointmap: [off] - scotch: [on,off] - vtk: [off] - int: [int32_t] - - include: - # test vtk only without scotch - - os: ubuntu-20.04 - pattern: off - pointmap: off - scotch: off - vtk: on - int: int32_t - - # Test pointmap with scotch excep - - os: ubuntu-20.04 - pattern: off - pointmap: on - scotch: on - vtk: off - int: int32_t - - # Test int64_t build on all archi - - os: ubuntu-20.04 - pattern: on - pointmap: on - scotch: on - vtk: on - int: int64_t - - - os: ubuntu-20.04 - pattern: off - pointmap: off - scotch: on - vtk: on - int: int64_t - - - os: ubuntu-20.04 - pattern: off - pointmap: off - scotch: off - vtk: off - int: int64_t - steps: - name: Checkout repository # Codecov need the source code to pair with coverage @@ -421,8 +373,7 @@ jobs: - name: Download coverage artifact uses: actions/download-artifact@v4 with: - name: build-${{ matrix.os }}-${{ matrix.pattern }}-${{ matrix.pointmap }}-${{ matrix.scotch }}-${{ matrix.vtk }}-${{ matrix.int }} - path: build + pattern: build-* - name: Upload coverage to Codecov if: matrix.os == 'ubuntu-20.04' && inputs.code_coverage == true From 878af1a4dadddfcb4180bd9a5f16e8075089fd38 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 19 Apr 2024 15:53:46 +0200 Subject: [PATCH 6/8] Fix wrong test in codecov-action. --- .github/workflows/main-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main-job.yml b/.github/workflows/main-job.yml index 3fae004f1..921c9074b 100644 --- a/.github/workflows/main-job.yml +++ b/.github/workflows/main-job.yml @@ -376,7 +376,7 @@ jobs: pattern: build-* - name: Upload coverage to Codecov - if: matrix.os == 'ubuntu-20.04' && inputs.code_coverage == true + if: inputs.code_coverage == true uses: codecov/codecov-action@v4 with: fail_ci_if_error: true From 09315c3d977f1a03176ea1a332a80d14f321bbf1 Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 19 Apr 2024 20:09:50 +0200 Subject: [PATCH 7/8] Revert "TO REVERT: speed up testing while coverage is being modified" This reverts commit c8c24566db71d9bb864d974d4dcb9fcd0c6835dc. --- .github/workflows/main-job.yml | 94 ++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 45 deletions(-) diff --git a/.github/workflows/main-job.yml b/.github/workflows/main-job.yml index 921c9074b..5fd96d9dd 100644 --- a/.github/workflows/main-job.yml +++ b/.github/workflows/main-job.yml @@ -261,50 +261,50 @@ jobs: with: path: mmg - #- 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 \ - # -DUSE_POINTMAP=${{ matrix.pointmap }} \ - # -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 \ - # -DUSE_POINTMAP=${{ matrix.pointmap }} \ - # -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 \ + -DUSE_POINTMAP=${{ matrix.pointmap }} \ + -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 \ + -DUSE_POINTMAP=${{ matrix.pointmap }} \ + -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: | @@ -321,7 +321,11 @@ jobs: -DSCOTCH_DIR=scotch-install \ -DUSE_VTK=${{ matrix.vtk }} \ -DMMG5_INT=${{ matrix.int }} \ - -DONLY_VERY_SHORT_TESTS=ON + -DTEST_LIBMMG=ON \ + -DTEST_LIBMMGS=ON \ + -DTEST_LIBMMG2D=ON \ + -DTEST_LIBMMG3D=ON \ + ${{ inputs.add_cmake_cfg_args }} shell: bash - name: Build Mmg From ea83b7c3cb09b70ce8b4354be2370ac7b37fb3de Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Fri, 19 Apr 2024 22:24:48 +0200 Subject: [PATCH 8/8] download only ubuntu artifacts. --- .github/workflows/main-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main-job.yml b/.github/workflows/main-job.yml index 5fd96d9dd..111f2a252 100644 --- a/.github/workflows/main-job.yml +++ b/.github/workflows/main-job.yml @@ -377,7 +377,7 @@ jobs: - name: Download coverage artifact uses: actions/download-artifact@v4 with: - pattern: build-* + pattern: build-ubuntu-* - name: Upload coverage to Codecov if: inputs.code_coverage == true