From 4baa7727230ee1bdfc52130f0c82d32edfd302c2 Mon Sep 17 00:00:00 2001 From: epernod Date: Wed, 10 Jun 2026 12:01:36 +0200 Subject: [PATCH 01/11] [ci] new logic for ci workflow to use macOS only on demand or for releases --- .github/workflows/ci.yml | 88 ++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 45 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72327cc..690f3a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,35 +5,47 @@ on: branches: - main - master - tags: - - 'v*' #release tags in format of 'v25.12.00' for example + - 'v*' pull_request: types: [opened, synchronize, reopened, labeled] + workflow_dispatch: + inputs: + full_build: + description: "Run full build (including macOS)" + required: false + default: false + type: boolean + + jobs: build-and-test: name: Run on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} / MeshRefinement=${{ matrix.with_mesh_refinement }} + if: > github.event_name == 'push' || ( github.event_name == 'pull_request' && - ( - contains(github.event.pull_request.labels.*.name, 'pr: run ci') && - ( - github.event.action != 'labeled' || - github.event.label.name == 'pr: run ci' - ) - ) - ) + contains(github.event.pull_request.labels.*.name, 'pr: run ci') + ) || + github.event_name == 'workflow_dispatch' || + startsWith(github.ref, 'refs/tags/') runs-on: ${{ matrix.os }} strategy: fail-fast: false + matrix: - os: [ubuntu-22.04, macos-14, windows-2022] + os: ${{ fromJSON( + github.event_name == 'pull_request' || + (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) ? + '["ubuntu-22.04","windows-2022"]' : + '["ubuntu-22.04","windows-2022","macos-14"]' + ) }} + sofa_branch: [master] with_mesh_refinement: [ON, OFF] @@ -56,7 +68,7 @@ jobs: repository: InfinyTech3D/MeshRefinement token: ${{ secrets.MESH_REFINEMENT_DEPLOY_KEY }} - ############### Build and install MeshRefinement only if enabled ############## + ############### Build and install MeshRefinement ############## - name: Build and install MeshRefinement if: matrix.with_mesh_refinement == 'ON' shell: bash @@ -66,16 +78,15 @@ jobs: if [[ "$RUNNER_OS" == "Windows" ]]; then cmd //c "${{ steps.sofa.outputs.vs_vsdevcmd }} \ && cd /d %GITHUB_WORKSPACE%/deps/MeshRefinement/build \ - && cmake \ - -GNinja \ + && cmake -GNinja \ -DCMAKE_PREFIX_PATH=$SOFA_ROOT/lib/cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%/deps/MeshRefinement/install \ .. \ && ninja install" - # Temp hack + cp deps/MeshRefinement/install/bin/MeshRefinement.dll "$WORKSPACE_BUILD_PATH/" - + else cd deps/MeshRefinement/build cmake \ @@ -92,17 +103,16 @@ jobs: - name: Checkout current source code uses: actions/checkout@v4 with: - path: ${{ env.WORKSPACE_SRC_PATH }} - - ################ Build and install current plugin ############## + path: ${{ env.WORKSPACE_SRC_PATH }} + + ################ Build and install plugin ############## - name: Build and install shell: bash run: | if [[ "$RUNNER_OS" == "Windows" ]]; then cmd //c "${{ steps.sofa.outputs.vs_vsdevcmd }} \ && cd /d %GITHUB_WORKSPACE%/build \ - && cmake \ - -GNinja \ + && cmake -GNinja \ -DCMAKE_PREFIX_PATH=%SOFA_ROOT%/lib/cmake;%GITHUB_WORKSPACE%/deps/MeshRefinement/install \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%/install \ @@ -122,16 +132,12 @@ jobs: -DCMAKE_LIBRARY_OUTPUT_DIRECTORY="$WORKSPACE_BUILD_PATH/lib" \ ../src ninja install - echo ${CCACHE_BASEDIR} ccache -s fi - + + ################### Artifact naming ############## - name: Sanitize artifact name id: sanitize - # This step removes special characters from the artifact name to ensure compatibility with upload-artifact - # Characters removed: " : < > | * ? \r \n \ / - # Spaces are replaced with underscores - # This sanitization prevents errors in artifact creation and retrieval shell: pwsh run: | if ("${{ matrix.with_mesh_refinement }}" -eq "ON") { @@ -140,28 +146,20 @@ jobs: else { $dependency = "standalone" } - - $originalName = "InfinyToolkit_${dependency}_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}" + + $originalName = "InfinyToolkit_${dependency}_${{ steps.sofa.outputs.run_branch }}_SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}" $artifact_name = $originalName -replace '[":;<>|*?\r\n\\/]', '' -replace ' ', '_' echo "artifact_name=$artifact_name" >> $env:GITHUB_OUTPUT - - ################### Create and upload artifact ############## + + ################### Upload artifact ############## - name: Create artifact - id: create-artifact uses: actions/upload-artifact@v4.4.0 with: name: ${{ steps.sanitize.outputs.artifact_name }} path: ${{ env.WORKSPACE_INSTALL_PATH }} - - name: Install artifact - uses: actions/download-artifact@v4.1.7 - with: - name: ${{ steps.sanitize.outputs.artifact_name }} - path: ${{ env.WORKSPACE_ARTIFACT_PATH }} - - - - name: Launch test - id: tests + ################### Tests ############## + - name: Launch test uses: sofa-framework/sofa-test-action@v1.0 with: sofa_root: ${{ github.workspace }}/sofa @@ -173,13 +171,13 @@ jobs: nb_parallel_threads: '4' - deploy: name: Deploy artifacts - if: always() && startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/v') needs: [build-and-test] runs-on: ubuntu-latest continue-on-error: true + steps: - name: Get artifacts uses: actions/download-artifact@v4.1.7 @@ -193,6 +191,7 @@ jobs: for artifact in *; do zip $artifact.zip -r $artifact/* done + - name: Upload release uses: softprops/action-gh-release@v1 with: @@ -203,5 +202,4 @@ jobs: files: | artifacts/InfinyToolkit_*_Linux.zip artifacts/InfinyToolkit_*_Windows.zip - artifacts/InfinyToolkit_*_macOS.zip - + artifacts/InfinyToolkit_*_macOS.zip \ No newline at end of file From 64a0dd24d6f71a8cf66c55b007ed3608ae47e870 Mon Sep 17 00:00:00 2001 From: epernod Date: Wed, 10 Jun 2026 12:17:49 +0200 Subject: [PATCH 02/11] restore some wanted lines --- .github/workflows/ci.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 690f3a7..27e8d33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ on: - main - master tags: - - 'v*' + - 'v*' #release tags in format of e.g: 'v25.12.00' pull_request: types: [opened, synchronize, reopened, labeled] @@ -68,7 +68,7 @@ jobs: repository: InfinyTech3D/MeshRefinement token: ${{ secrets.MESH_REFINEMENT_DEPLOY_KEY }} - ############### Build and install MeshRefinement ############## + ############### Build and install MeshRefinement only if enabled ############## - name: Build and install MeshRefinement if: matrix.with_mesh_refinement == 'ON' shell: bash @@ -84,7 +84,7 @@ jobs: -DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%/deps/MeshRefinement/install \ .. \ && ninja install" - + # Temp hack cp deps/MeshRefinement/install/bin/MeshRefinement.dll "$WORKSPACE_BUILD_PATH/" else @@ -103,9 +103,9 @@ jobs: - name: Checkout current source code uses: actions/checkout@v4 with: + ################ Build and install current plugin ############## path: ${{ env.WORKSPACE_SRC_PATH }} - ################ Build and install plugin ############## - name: Build and install shell: bash run: | @@ -138,6 +138,10 @@ jobs: ################### Artifact naming ############## - name: Sanitize artifact name id: sanitize + # This step removes special characters from the artifact name to ensure compatibility with upload-artifact + # Characters removed: " : < > | * ? \r \n \ / + # Spaces are replaced with underscores + # This sanitization prevents errors in artifact creation and retrieval shell: pwsh run: | if ("${{ matrix.with_mesh_refinement }}" -eq "ON") { @@ -146,18 +150,24 @@ jobs: else { $dependency = "standalone" } - - $originalName = "InfinyToolkit_${dependency}_${{ steps.sofa.outputs.run_branch }}_SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}" + + $originalName = "InfinyToolkit_${dependency}_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }}" $artifact_name = $originalName -replace '[":;<>|*?\r\n\\/]', '' -replace ' ', '_' echo "artifact_name=$artifact_name" >> $env:GITHUB_OUTPUT - - ################### Upload artifact ############## + + ################### Create and upload artifact ############## - name: Create artifact + id: create-artifact uses: actions/upload-artifact@v4.4.0 with: name: ${{ steps.sanitize.outputs.artifact_name }} path: ${{ env.WORKSPACE_INSTALL_PATH }} + - name: Install artifact + uses: actions/download-artifact@v4.1.7 + with: + name: ${{ steps.sanitize.outputs.artifact_name }} + path: ${{ env.WORKSPACE_ARTIFACT_PATH }} ################### Tests ############## - name: Launch test uses: sofa-framework/sofa-test-action@v1.0 From ba46608d6240f3b90c4d8bbb49a15159872de50d Mon Sep 17 00:00:00 2001 From: epernod Date: Wed, 10 Jun 2026 12:33:02 +0200 Subject: [PATCH 03/11] update actions logic and condition --- .github/workflows/ci.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27e8d33..46c8581 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,10 +28,13 @@ jobs: github.event_name == 'push' || ( github.event_name == 'pull_request' && - contains(github.event.pull_request.labels.*.name, 'pr: run ci') + ( + contains(github.event.pull_request.labels.*.name, 'pr: run ci') || + github.event.action == 'labeled' + ) ) || github.event_name == 'workflow_dispatch' || - startsWith(github.ref, 'refs/tags/') + startsWith(github.ref, 'refs/tags/v') runs-on: ${{ matrix.os }} @@ -41,9 +44,10 @@ jobs: matrix: os: ${{ fromJSON( github.event_name == 'pull_request' || - (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) ? - '["ubuntu-22.04","windows-2022"]' : - '["ubuntu-22.04","windows-2022","macos-14"]' + (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v')) || + (github.event_name == 'workflow_dispatch' && inputs.full_build != 'true') + ? '["ubuntu-22.04","windows-2022"]' + : '["ubuntu-22.04","windows-2022","macos-14"]' ) }} sofa_branch: [master] From e0cf97f6202f124e1ecb1013ad4e6323320aef96 Mon Sep 17 00:00:00 2001 From: epernod Date: Wed, 10 Jun 2026 13:59:20 +0200 Subject: [PATCH 04/11] =?UTF-8?q?Yes=20=E2=80=94=20your=20version=20is=20m?= =?UTF-8?q?uch=20closer=20to=20the=20correct=20logic=20than=20mine,=20and?= =?UTF-8?q?=20it=20correctly=20preserves=20the=20=E2=80=9Clabel=20is=20the?= =?UTF-8?q?=20gate=E2=80=9D=20+=20=E2=80=9Cruns=20on=20subsequent=20pushes?= =?UTF-8?q?=E2=80=9D=20behavior.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46c8581..5f54223 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,16 +25,17 @@ jobs: name: Run on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} / MeshRefinement=${{ matrix.with_mesh_refinement }} if: > - github.event_name == 'push' || + github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v') || ( github.event_name == 'pull_request' && ( - contains(github.event.pull_request.labels.*.name, 'pr: run ci') || - github.event.action == 'labeled' + contains(github.event.pull_request.labels.*.name, 'pr: run ci') && + ( + github.event.action != 'labeled' || + github.event.label.name == 'pr: run ci' + ) ) - ) || - github.event_name == 'workflow_dispatch' || - startsWith(github.ref, 'refs/tags/v') + ) runs-on: ${{ matrix.os }} From 0748519974ddef99359f6283f74c85a6f1f928cb Mon Sep 17 00:00:00 2001 From: erik pernod Date: Wed, 10 Jun 2026 14:01:12 +0200 Subject: [PATCH 05/11] Fix indentation in CI workflow file --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f54223..96389ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,9 +108,9 @@ jobs: - name: Checkout current source code uses: actions/checkout@v4 with: - ################ Build and install current plugin ############## path: ${{ env.WORKSPACE_SRC_PATH }} - + + ################ Build and install current plugin ############## - name: Build and install shell: bash run: | @@ -217,4 +217,4 @@ jobs: files: | artifacts/InfinyToolkit_*_Linux.zip artifacts/InfinyToolkit_*_Windows.zip - artifacts/InfinyToolkit_*_macOS.zip \ No newline at end of file + artifacts/InfinyToolkit_*_macOS.zip From 83c6b29128ba745d03da671a5e28d24a6b5a2849 Mon Sep 17 00:00:00 2001 From: erik pernod Date: Wed, 10 Jun 2026 14:02:42 +0200 Subject: [PATCH 06/11] Update CI workflow to include artifact creation and tests Added steps for creating plugin artifacts and launching tests. --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96389ae..4959aac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,7 +109,7 @@ jobs: uses: actions/checkout@v4 with: path: ${{ env.WORKSPACE_SRC_PATH }} - + ################ Build and install current plugin ############## - name: Build and install shell: bash @@ -173,6 +173,7 @@ jobs: with: name: ${{ steps.sanitize.outputs.artifact_name }} path: ${{ env.WORKSPACE_ARTIFACT_PATH }} + ################### Tests ############## - name: Launch test uses: sofa-framework/sofa-test-action@v1.0 @@ -186,6 +187,7 @@ jobs: nb_parallel_threads: '4' + ################### Create plugin artifacts ############## deploy: name: Deploy artifacts if: startsWith(github.ref, 'refs/tags/v') From 0e7a23a8e414afd798ad78a3306679e39744a7fc Mon Sep 17 00:00:00 2001 From: erik pernod Date: Wed, 10 Jun 2026 14:10:57 +0200 Subject: [PATCH 07/11] Remove unnecessary blank line in ci.yml --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4959aac..b27ca59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,6 @@ on: default: false type: boolean - jobs: build-and-test: name: Run on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} / MeshRefinement=${{ matrix.with_mesh_refinement }} From 9b4790e9dad14812783f1209d9607af0b6ecefb6 Mon Sep 17 00:00:00 2001 From: erik pernod Date: Wed, 10 Jun 2026 14:51:42 +0200 Subject: [PATCH 08/11] Update CI workflow to limit OS matrix Simplified the OS matrix for CI workflow to only include Ubuntu and Windows. --- .github/workflows/ci.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b27ca59..29e844b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,14 +42,8 @@ jobs: fail-fast: false matrix: - os: ${{ fromJSON( - github.event_name == 'pull_request' || - (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v')) || - (github.event_name == 'workflow_dispatch' && inputs.full_build != 'true') - ? '["ubuntu-22.04","windows-2022"]' - : '["ubuntu-22.04","windows-2022","macos-14"]' - ) }} - + os: [ubuntu-22.04, windows-2022] + sofa_branch: [master] with_mesh_refinement: [ON, OFF] From ec969e5b12eaa87c2a3b4d5076bf75230392db02 Mon Sep 17 00:00:00 2001 From: erik pernod Date: Wed, 10 Jun 2026 15:08:11 +0200 Subject: [PATCH 09/11] Update CI workflow to include macOS support Add conditional environment variable for macOS builds. --- .github/workflows/ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29e844b..e1e5254 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,11 @@ on: default: false type: boolean +env: + RUN_MACOS: ${{ !(github.event_name == 'pull_request' || + (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v')) || + (github.event_name == 'workflow_dispatch' && inputs.full_build != 'true')) }} + jobs: build-and-test: name: Run on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} / MeshRefinement=${{ matrix.with_mesh_refinement }} @@ -42,7 +47,9 @@ jobs: fail-fast: false matrix: - os: [ubuntu-22.04, windows-2022] + os: ${{ fromJSON(env.RUN_MACOS == 'true' + && '["ubuntu-22.04","windows-2022","macos-14"]' + || '["ubuntu-22.04","windows-2022"]') }} sofa_branch: [master] with_mesh_refinement: [ON, OFF] From 33d401d3030fd07d0fa6ec00844f53defb146466 Mon Sep 17 00:00:00 2001 From: erik pernod Date: Wed, 10 Jun 2026 15:14:14 +0200 Subject: [PATCH 10/11] Update CI workflow OS selection conditions Refactor CI workflow to simplify OS selection logic. --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1e5254..dc87ae2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,11 +19,7 @@ on: default: false type: boolean -env: - RUN_MACOS: ${{ !(github.event_name == 'pull_request' || - (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v')) || - (github.event_name == 'workflow_dispatch' && inputs.full_build != 'true')) }} - + jobs: build-and-test: name: Run on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} / MeshRefinement=${{ matrix.with_mesh_refinement }} @@ -47,9 +43,13 @@ jobs: fail-fast: false matrix: - os: ${{ fromJSON(env.RUN_MACOS == 'true' - && '["ubuntu-22.04","windows-2022","macos-14"]' - || '["ubuntu-22.04","windows-2022"]') }} + os: ${{ fromJSON( + (github.event_name == 'pull_request' || + (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v')) || + (github.event_name == 'workflow_dispatch' && inputs.full_build != 'true')) + && '["ubuntu-22.04","windows-2022"]' + || '["ubuntu-22.04","windows-2022","macos-14"]' + ) }} sofa_branch: [master] with_mesh_refinement: [ON, OFF] From 930129311ef86effa600efb0dfa35e08cd0cd769 Mon Sep 17 00:00:00 2001 From: erik pernod Date: Wed, 10 Jun 2026 15:32:24 +0200 Subject: [PATCH 11/11] Add prepare job to set OS list for CI workflow --- .github/workflows/ci.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc87ae2..db7a8bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,21 @@ on: jobs: + prepare: + runs-on: ubuntu-latest + outputs: + os_list: ${{ steps.set.outputs.os_list }} + steps: + - id: set + run: | + if [[ "${{ github.event_name }}" == "pull_request" ]] || + [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" != refs/tags/v* ]] || + [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.full_build }}" != "true" ]]; then + echo 'os_list=["ubuntu-22.04","windows-2022"]' >> $GITHUB_OUTPUT + else + echo 'os_list=["ubuntu-22.04","windows-2022","macos-14"]' >> $GITHUB_OUTPUT + fi + build-and-test: name: Run on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} / MeshRefinement=${{ matrix.with_mesh_refinement }} @@ -43,13 +58,7 @@ jobs: fail-fast: false matrix: - os: ${{ fromJSON( - (github.event_name == 'pull_request' || - (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v')) || - (github.event_name == 'workflow_dispatch' && inputs.full_build != 'true')) - && '["ubuntu-22.04","windows-2022"]' - || '["ubuntu-22.04","windows-2022","macos-14"]' - ) }} + os: ${{ fromJSON(needs.prepare.outputs.os_list) }} sofa_branch: [master] with_mesh_refinement: [ON, OFF]