diff --git a/.github/workflows/arm-main.yml b/.github/workflows/arm-main.yml index 61ed49a381e..fa5ff12b6cc 100644 --- a/.github/workflows/arm-main.yml +++ b/.github/workflows/arm-main.yml @@ -380,8 +380,14 @@ jobs: working-directory: ${{ runner.workspace }}/build - name: Run Package - run: cpack -C ${{ inputs.build_mode }} -V + run: | + # Disable indexing to prevent file locking during CPack + sudo mdutil -i off / || true + + # Run cpack with retry + cpack -C ${{ inputs.build_mode }} -V || (sleep 5 && cpack -C ${{ inputs.build_mode }} -V) working-directory: ${{ runner.workspace }}/build + shell: bash - name: List files in the space run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58231f61e3a..5196690f6cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -308,8 +308,18 @@ jobs: if: ${{ matrix.run_tests }} - name: Run Package - run: cpack -C ${{ inputs.build_mode }} -V + run: | + if [[ "${{ matrix.ostype }}" == "macos" ]]; then + # Disable indexing to prevent file locking during CPack + sudo mdutil -i off / || true + + # Run cpack with retry + cpack -C ${{ inputs.build_mode }} -V || (sleep 5 && cpack -C ${{ inputs.build_mode }} -V) + else + cpack -C ${{ inputs.build_mode }} -V + fi working-directory: ${{ runner.workspace }}/build + shell: bash # if: ${{ (matrix.ostype != 'macos') && (inputs.build_mode != 'Debug') }} # - name: Run Package (Mac_latest) diff --git a/.github/workflows/maven-staging.yml b/.github/workflows/maven-staging.yml index fddc38fca02..34519faf5eb 100644 --- a/.github/workflows/maven-staging.yml +++ b/.github/workflows/maven-staging.yml @@ -306,8 +306,26 @@ jobs: id: buildhdf5 shell: bash run: | + # macOS: Disable Spotlight indexing to prevent file locking during CPack + if [[ "$RUNNER_OS" == "macOS" ]]; then + echo "Disabling Spotlight indexing temporarily" + sudo mdutil -i off / || true + fi + cd "${{ github.workspace }}" - cmake --workflow --preset="${{ steps.set-preset.outputs.preset }}" --fresh + + # Run workflow with retry logic for macOS CPack failures + if [[ "$RUNNER_OS" == "macOS" ]]; then + echo "Running CMake workflow with macOS retry logic..." + if ! cmake --workflow --preset="${{ steps.set-preset.outputs.preset }}" --fresh; then + echo "⚠️ First attempt failed, retrying in 5 seconds..." + sleep 5 + cmake --workflow --preset="${{ steps.set-preset.outputs.preset }}" --fresh + fi + else + # Non-macOS: run normally without retry + cmake --workflow --preset="${{ steps.set-preset.outputs.preset }}" --fresh + fi - name: Extract version information id: version-info