From 77defdc753b894004d0eb3ca992001c617187616 Mon Sep 17 00:00:00 2001 From: Pascal Thomet Date: Mon, 5 Aug 2024 13:47:33 +0200 Subject: [PATCH] Try fix intermittent CI failures / VcpkgPackage CI on macOS --- .github/workflows/VcpkgPackage.yml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/VcpkgPackage.yml b/.github/workflows/VcpkgPackage.yml index 696c3bfb..7084d253 100644 --- a/.github/workflows/VcpkgPackage.yml +++ b/.github/workflows/VcpkgPackage.yml @@ -81,10 +81,29 @@ jobs: # - name: Setup interactive tmate session # uses: mxschmitt/action-tmate@v3 - # Run the test + # Run the test with 3 retries max + # (because sometimes the vcpkg package build fails due to network issues, + # or maybe GH rate limiting) - name: run test shell: bash + env: + VCPKG_ROOT: ${{ github.workspace }}/vcpkg + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - export VCPKG_ROOT=$(pwd)/vcpkg cd .github/ci_vcpkg_package_tests - python run_ci_vcpkg_package_tests.py + max_retries=3 + count=0 + success=false + + until [ $success = true ] || [ $count -eq $max_retries ]; do + python run_ci_vcpkg_package_tests.py && success=true || count=$((count + 1)) + if [ $success = false ]; then + echo "Retrying... ($count/$max_retries)" + sleep 10 + fi + done + + if [ $success = false ]; then + echo "Failed after $max_retries attempts" + exit 1 + fi \ No newline at end of file