diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa4e72b..5c6af90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,27 +116,40 @@ jobs: && cmd //c "${{ steps.sofa.outputs.vs_vsdevcmd }} \ && cd /d $GITHUB_WORKSPACE/build_release \ && cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DUSE_BLAS_FOR_OPTIMUS=0 \ + -DCMAKE_INSTALL_PREFIX=${{ env.WORKSPACE_INSTALL_PATH }} \ -DCMAKE_PREFIX_PATH="$SOFA_ROOT/build_release/install";$EIGEN_INSTALL_DIR/build_release .. \ && ninja install" else mkdir $GITHUB_WORKSPACE/build_release cd $GITHUB_WORKSPACE/build_release - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$SOFA_ROOT/build_release/install .. + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ env.WORKSPACE_INSTALL_PATH }} -DCMAKE_PREFIX_PATH=$SOFA_ROOT/build_release/install .. make -j 8 make install fi + - 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: | + $originalName = "Optimus_${{ 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 + - name: Create artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4.4.0 with: - name: Optimus_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }} - path: ${{ github.workspace }}/build_release/install + name: ${{ steps.sanitize.outputs.artifact_name }} + path: ${{ env.WORKSPACE_INSTALL_PATH }} - name: Install artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4.1.7 with: - name: Optimus_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }} - path: ${{ github.workspace }}/build_release/install + name: ${{ steps.sanitize.outputs.artifact_name }} + path: ${{ env.WORKSPACE_ARTIFACT_PATH }} - name: Optimus tests shell: bash @@ -171,7 +184,7 @@ jobs: continue-on-error: true steps: - name: Get artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4.1.7 with: path: artifacts